Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • [SOLVED] One out of two Q_PROPERTY working

    2
    0 Votes
    2 Posts
    729 Views
    M
    I have been looking for this for about an hour and four my problem, silly mistakes when registering types with copy/paste , both My1stObject and My2ndObject where registered with the same qmlName
  • [Solved]Crash application with ButtonStyle QtQuickControls

    16
    0 Votes
    16 Posts
    3k Views
    N
    In Qt5.3 (mscv2013-64bit) its works :)
  • [Solved] How to reload QML file with ApplicationWindow object?

    4
    0 Votes
    4 Posts
    10k Views
    ?
    Hi, I was also looking for a similar solution. Thank you
  • [Solved] Scrollable Grid in Qt?

    5
    0 Votes
    5 Posts
    4k Views
    M
    nvm i got it! Thanks for the help with the scrolling :D
  • Use QtQuick components in Qt 5.2

    3
    0 Votes
    3 Posts
    797 Views
    S
    Thanks Jens, I wasn't aware that it hadn't actually released. I'll be looking through that repo today.
  • Using QList in QML

    3
    0 Votes
    3 Posts
    819 Views
    ?
    [quote author="Vincent007" date="1394117348"]use "QQmlListProperty":http://qt-project.org/doc/qt-5/qqmllistproperty.html instead of QList. Or use Qt C++ model to contain your QList items.[/quote] Thank you.
  • Passing class object inside Q_PROPERTY and bind it with the QML file

    3
    0 Votes
    3 Posts
    816 Views
    ?
    [quote author="Vincent007" date="1394117877"]Yes, I think it is possible, If your class is a QObject-dervied class.[/quote] Can you give me an example ?
  • Resizing Main Windows QML

    15
    0 Votes
    15 Posts
    10k Views
    O
    Oh alright, so you basically want the part with the resizing, you already got your part done with the clicking? For the resizing part you'll still need a resize function in your mainwindow class. Let's keep the old one from above. In QML you'll just resize your top-level-component. If it is for example a Rectangle: @Rectangle { id: topLevelComp // more code .. }@ We'll give it an id. So if we have to resize the window, like for example with the onClicked: notification of a MouseArea, we just execute: @onClicked: { topLevelComp.width = 0 topLevelComp.height = 0 }@ The QML-resize part is mostly done. We now need a signal in our QML so we can call a Cpp function. For that we just declare it that way: @Rectangle { id: topLevelComp signal resizeMyApplication() // more code .. }@ Now we can emit it in our onClicked notification: @onClicked: { topLevelComp.width = 0 topLevelComp.height = 0 resizeMyApplication() }@ In Cpp we have got our QML-ApplicationViewer. For that case i'll use a QQuickView. We have to get the rootObject() of our Viewer: @QQuickView *view = new QQuickView(); // ... some code QObject *obj = (QObject *)view->rootObject();@ Now we just have to connect the signal with a given slot or signal, for example: @connect(obj, SIGNAL(resizeMyApplication()), this, SLOT(resizeMe()));@ You'll need the resizeMe() slot for that. In the slot you just execute the void MainWindow::rescaleWindow(int w, int h, int x, int y) function. You can also put the resize directly into the slot: @{ this->setGeometry(x, y, w, h); }@ I hope that you'll understand what i mean and that i could help you. Feel free to ask for further informations or read this documentations: "Qml Cpp Integration":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-topic.html "Interacting with QML Objects from Cpp ":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-interactqmlfromcpp.html "Thread on how to: invoke QML methods":http://qt-project.org/forums/viewthread/36154
  • How to do Audio Recording from microphone to wav file in Qt

    4
    0 Votes
    4 Posts
    2k Views
    O
    Well it doesn't look like it is a Qt or Cpp problem. I have not worked with matlab yet so i might be wrong but maybe you have to set the correct chunksize and other necessary settings in matlab? bq. so please tell me how to set chunk size, sample rate, bit rate You'll find all the record-settings here: "QAudioEncoderSettings":http://qt-project.org/doc/qt-5.0/qtmultimedia/qaudioencodersettings.html
  • [solved]How do I detect if a rect's members are changed?

    6
    0 Votes
    6 Posts
    1k Views
    O
    [quote author="bobbaluba" date="1394100498"]onek24 that will just give you notifications when the dimensions of the Item itself changes. Item has properties called width, height, x, y.[/quote] Yes that is right, my answer was based on the answer of Jens who also used the notification onWidthChanged. I just wanted to provide you a way without the Connector.
  • Injecting Events From C++

    6
    0 Votes
    6 Posts
    2k Views
    O
    Alright, glad to see you found a solution. I am also parsing all children recursively. If i couldn't find a children in my list when i try to access it trough my class, it'll search the RootObject again for all children and add it to the list if it found it. This would fix the problem with dynamic object creation in qml, well at least for my purposes. For your purposes i would go ahead and add a signal on which it'll update the list of objects emitted by every created qml-component/object.
  • Get Repeater's child

    13
    0 Votes
    13 Posts
    11k Views
    A
    Thank you for this answer, was very helpful!
  • ShaderEffect explication for 3D effect

    1
    0 Votes
    1 Posts
    633 Views
    No one has replied
  • MouseArea from one state still active in other states

    2
    0 Votes
    2 Posts
    689 Views
    B
    Ok, well Bidochon, next time just post your question sooner and you won't have to struggle with it for hours. The solution, like you said in your post was to use enabled: false and all you had to do is add this statement in the State like this @ State { name: "loadstep" PropertyChanges { target: introstep opacity: 0 } PropertyChanges { target: prepastep opacity: 0 } PropertyChanges { target: loadstep opacity: 1 } PropertyChanges { target: topmenu opacity: 1 } PropertyChanges { target: prepastep enabled: false } @ ps: Somehow, I always have to ask the question here to figure out the answer myself 10 seconds later…. is that a sign that I need friends ? :-) Bidochon ps: hope that will help someone else out there.
  • Programmatically scrolling ScrollView

    4
    0 Votes
    4 Posts
    3k Views
    J
    I was finally able to move my scroll position by setting ScrollView.flickableItem.contentY
  • [Solved] QML Draw order

    7
    1 Votes
    7 Posts
    15k Views
    M
    [quote author="tedmiddleton" date="1370140219"] Having to hack the tooltip under the common parent to get draw order right is ugly because it works against code re-use and encapsulation. Because of this issue, as far as the knowledge that I have right now goes, I wouldn't be able to make a reusable widget that draws its own tooltips. [/quote] I have the same problem as you, and I was looking for a solution without breaking the encapsulation rules, if you got any please let me know. Thanks
  • Move particles through a custom path

    1
    0 Votes
    1 Posts
    467 Views
    No one has replied
  • Resizing QML controls

    3
    0 Votes
    3 Posts
    1k Views
    ?
    [quote author="Jens" date="1394013563"]This is what GridLayout is for: http://qt-project.org/doc/qt-5.1/qtquicklayouts/qml-qtquick-layouts1-gridlayout.html There is also an example that shows how to use it here: http://qt-project.org/doc/qt-5/qtquickcontrols-controls-basiclayouts-example.html[/quote] Hi Jens, Thank you very much. I was really looking for this control. Warm Regards Ansif
  • Passing parameters between windows

    3
    0 Votes
    3 Posts
    3k Views
    F
    ok I solved without knowing it. the data is from this javascript function. in the dialog was enough for me to do so: @ Text { anchors.centerIn: parent text: "AUTORE: " + author + "\n" + "EDITORE: " + editor } @ this is the javascript function, and is called in the main.qml @ function load() { listModelJson.clear(); var xhr = new XMLHttpRequest(); xhr.open("GET","http://www.sito.com/file.php", true); xhr.onreadystatechange = function() { if (xhr.readyState == xhr.DONE) { if (xhr.status == 200) { var jsonObject = JSON.parse(xhr.responseText); for (var i in jsonObject) { listModelJson.append({ "title" : jsonObject[i].title, "author" : jsonObject[i].author, "editor" : jsonObject[i].editor }); } } } } xhr.send(); } @ thanks!!
  • [solved] Custom dialog

    4
    0 Votes
    4 Posts
    2k Views
    J
    And another sample, based on window: @ import QtQuick 2.0 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 Rectangle { width: 400 height: 400 Window { id: win_dialog flags: Qt.Dialog title: "Error message" modality: Qt.ApplicationModal ColumnLayout { anchors.fill: parent Text { text: "Text of sample" } Button { text: "close" onClicked: { win_dialog.visible = false; } } } visible: false } Button { text: "Show dialog" onClicked: win_dialog.visible = true; } } @