Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.1k Posts
  • [Solved]QML dropdown list with images

    6
    0 Votes
    6 Posts
    8k Views
    G
    Thanks for all that works ! ;))
  • 0 Votes
    2 Posts
    823 Views
    C
    Hi, You're printing that out in a signal handler for a property change signal. That means that if two.f0 is initialized before two.listt and two.width then you are seeing expected behaviour. Remember, QML is declarative, so the order of property initialization is not defined by the order it appears in the code (that would be imperative, not declarative). You should wait until the Component.onCompleted signal is emitted - at that point, all of the property initializations are guaranteed to be complete. Cheers, Chris.
  • [solved] Flickable doesn't function in a Column

    7
    0 Votes
    7 Posts
    2k Views
    ?
    Glad I could help you.
  • [solved] Find a quick item by name

    3
    0 Votes
    3 Posts
    1k Views
    J
    Thanks
  • Get all the children form an element, even the "outerly added children"

    6
    0 Votes
    6 Posts
    1k Views
    X
    Maybe the Items added to the Button in you main.qml are not added to the button directly but to a new Item, I am not sure how QML works if you create objects from QML files but you might create a new derived Item and that is why the other Items are not found in your loop? so you can maybe try the parent of you button? try and use the QML debugger to see the item tree or print this to the console and see for yourself: @ console.log(parent.children.length, parent.parent.children.length) @ maybe you need to also use the parent.parent.children list?
  • Selective crop when using Transitions

    21
    0 Votes
    21 Posts
    5k Views
    M
    Meanwhile, I think the best I can do is simply to toggle the clip property to set it to false whilst the animation is in progress and then set true on completion. Its a bit flickery, but not bad. The "onRunningChanged:" is the crucial part, so thank you very much for all your help Xander84. @add: Transition { onRunningChanged: { list.clip = (running ? false : true); } NumberAnimation { properties: "x"; from: list.finalVrnOrigin.x; duration: 1000 } NumberAnimation { properties: "y"; from: list.finalVrnOrigin.y; duration: 1000 } NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 1000 } } addDisplaced: Transition { NumberAnimation { properties: "x,y"; duration: 1000 } } @
  • How to create and access database

    2
    0 Votes
    2 Posts
    653 Views
    EddyE
    Hi, I woiuld suggest to read "this model view tutorial":http://qt-project.org/doc/qt-5/modelview.html it has many links to usefull information Have a close look at QFileSystemModel
  • [SOLVED] C++ object as property parameter

    3
    0 Votes
    3 Posts
    991 Views
    K
    Yeah, so simple, thanks. Sometimes it is hard to do the step from a strongly typed language to Javascript/QML:-)
  • Change Item in ListView in a time interval

    8
    0 Votes
    8 Posts
    3k Views
    V
    Hi again! I notice that the next item when the interval ends, it's the fifth element item. How can I correct this? It's very strange because I'm using incrementCurrentIndex() method.
  • 0 Votes
    2 Posts
    683 Views
    X
    I don't think you can do that, but there are many ways to set the value. You could use a global property and bind it to the text and then easily change it from c++ or you get the specific QML item from c++ which is not that easy I think. Depending on how often you need to do that the quick (and maybe dirty) way is to use the evaluate function of the QML engine, there you can run any valid QML code like Javascript evil function, just from c++.
  • Listview delegate using Loader gives null element

    7
    0 Votes
    7 Posts
    2k Views
    M
    It does work ( I at least get rid of all the warnings ), but I don't find that solution really clean since if myModel is null then nothing should be loaded ..
  • How can I show streaming video with QML Video (rtsp) ?

    3
    0 Votes
    3 Posts
    5k Views
    T
    look at https://github.com/RSATom/QmlVlcDemo ..
  • How to store .wav file(media file) in sqllite databse

    5
    0 Votes
    5 Posts
    1k Views
    D
    I am no expert on wav files. Perhaps you should first try to write the QByteArray to a file with QFile::write(QByteArray) and then play it as you would normally.
  • Include QML in a Qt Widget application

    Locked
    3
    0 Votes
    3 Posts
    773 Views
    SGaistS
    Closing "Duplicate":http://qt-project.org/forums/viewthread/40749/
  • QScreen for KTV multi-screen application problem.

    2
    0 Votes
    2 Posts
    801 Views
    K
    OK, I have resolved it.
  • Connecting a Qt Quick Controls signal to a C++ slot

    2
    0 Votes
    2 Posts
    2k Views
    X
    Hi, there are many ways of doing what you want, so I can just tell your how I would do this in your case. Instead of connecting a QML signal to a c++ slot I usually just call the c++ slot from c++ (without any connections), that of course depends on your c++ file but you can easily register any QObject with the QML engine and then create objects of the class form QML and also call slots and any function marked with Q_INVOKEABLE. So in your case you don't need to use the QQmlContext or anything from the QtQuick2ApplicationViewer or whatever, but you just register your model class to the QML engine and then create the model object from QML, so you can have a "save" slot in the model (if that makes sense) and just call it. to register any QObject class to the QML engine you can simply use "qmlRegisterType":http://qt-project.org/doc/qt-5.0/qtqml/qqmlengine.html#qmlRegisterType in your main.cpp (before the QML engine is created, even be before QGuiApplication): @ qmlRegisterType<YourModelClass>("YourModel", 1, 0, "YourModel"); @ and then create an object anywhere in QML with: @ import YourModel 1.0 YourModel { id: model } // in some QML function model.save() @ give it an ID like any other QML object and you can access it and call slots (and invokable methods), connect signals and use it as your model in the ListView (via the ID reference). If you want you can still create the model form c++ and use setContextProperty, if you have registered the class your should be able to invoke the slots on that object from QML but I think creating the model in QML is cleaner instead of a global context property? I hope that helps you, there might be some official tutorials on this, but this should get you started. :)
  • [SOLVED]Binding between C++ object and Listview delegate

    3
    0 Votes
    3 Posts
    2k Views
    M
    Sorry for the late answer, I got back to my code and it does work with your fix. Thanks
  • Efficiently update vector image in Qml Flickable on Android

    2
    0 Votes
    2 Posts
    1k Views
    X
    Hi, you may try and use a QOpenGLFramebufferObject instead of the QImage as the render target, also if your image doesn't change much you can cache the painted image/texture in your class I guess?
  • [Solved] SpinBox with in RowLayout

    6
    0 Votes
    6 Posts
    2k Views
    EddyE
    Thanks for the feedback here. Well appreciated!
  • 0 Votes
    1 Posts
    816 Views
    No one has replied