Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • [Android] Qt5.2 little Audioplayer with QMultimedia -> No sound

    1
    0 Votes
    1 Posts
    739 Views
    No one has replied
  • Application Architecture (StackView)

    3
    0 Votes
    3 Posts
    1k Views
    J
    Hmmm, You can use the StackView and re-use the same ListView over and over again if you want. When pushing a item onto the stack you can pass in arguments. See http://qt-project.org/doc/qt-5.1/qtquickcontrols/qml-qtquick-controls1-stackview.html section Pushing Items One argument could be the a reference to the model to be loaded. values in the properties argument the are applied on construction of the list view. Back is then automatically handled using pop() (selection preservation). The overhead in memory is to have all stacked list views in memory. If a list view is popped it will be destroyed. Also having these 20 different list view as separate files or components inside your project. If you need a C++ model, depends where your data comes from.
  • Drawing problem, some area does not draw well on Windows machine.

    14
    0 Votes
    14 Posts
    4k Views
    H
    Hello, the graphics card in my windows machine is Mobile Intel 4 Series Express Chipset Family. And I will try to issue the bug later.
  • Accesing a qml item from a ListModel

    2
    0 Votes
    2 Posts
    684 Views
    O
    Hello, i would go ahead and add an objectName to your Model and access its method get(int index): "object ListModel:.get()":http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-listmodel.html#get-method Otherwise you could try to access your Models child instead.
  • [Solved] QtQuick Application recommended "To-Do"s

    4
    0 Votes
    4 Posts
    1k Views
    O
    You're welcome, glad i could help you. It is not possible to close a thread, but you could edit your mainpost and add a [Solved] in front of the threadname.
  • Stack Template class

    6
    0 Votes
    6 Posts
    2k Views
    M
    nope... @ void Stack::push(const T&value) @ gives the same error
  • [Solved] Why is text scrolling choppy in Qml?

    2
    0 Votes
    2 Posts
    1k Views
    D
    Okay, I had to replace the video driver on my Fedora 20 install to take advantage of the proprietary nvidia card and enable vdpau/vaapi ... Here is the guide I used in case anyone needs to do this ... http://www.if-not-true-then-false.com/2014/fedora-20-nvidia-guide/ No more choppy animations. Plus my video looks much better now too.
  • Help needed using changeVersion

    2
    0 Votes
    2 Posts
    901 Views
    H
    So I figured out a solution to my problem. Unfortunately, it relies on undocumented behavior in the LocalStorage module, but it gets the job done. If you specify an empty string for the version, no version check is done; the database is simply opened.
  • How do I know when all QML element propreties have been initialized ?

    6
    0 Votes
    6 Posts
    1k Views
    A
    Thanks JKSH
  • C++ Registered Type QInvokable Call

    3
    0 Votes
    3 Posts
    2k Views
    JKSHJ
    Hi, and welcome to the Qt Dev Net! [quote]The best way I read is: Move the QObject derivate class database to another (new) thread with moveToThread ( QThread * targetThread ). Change the Q_INVOKABLE to exposed slots. And trigger the slots from QML.[/quote]Yes, I would recommend this approach too. [quote]Is it right that the slot calls are stored in a queue and are processed by the registered thread.[/quote]Correct. [quote]Is possible to return something?[/quote]You can emit a C++ signal, and connect it to a QML slot/function. Or, you can invoke the QML function using a queued connection. See "Interacting with QML Objects from C++|Invoking QML Methods":http://qt-project.org/doc/qt-5/qtqml-cppintegration-interactqmlfromcpp.html#invoking-qml-methods [quote]Where i can find the signal slot threading behavior documentaion?[/quote]The most important concepts are at "QObject|Thread Affinity":http://qt-project.org/doc/qt-5/QObject.html#thread-affinity The "QThread documentation":http://qt-project.org/doc/qt-5/qthread.html has good information too. Finally, see "Multithreading Technologies in Qt":http://qt-project.org/doc/qt-5/threads-technologies.html for a general overview.
  • How to implement your own type of ListModel?

    3
    0 Votes
    3 Posts
    950 Views
    Q
    I know how to create a model in C++ and pass it to QML and actually I am using C++ bindings with QML. I would like to do the mentioned in my post to be close to the syntax of a usual ListModel in QML, so people could follow those rules with my own Model. The only thing different from what I want, and I would like to remove, is that "nodes" property in MyModel. Thanks for your response!
  • [SOLVED] Is exist fututre plans for supproting tech like qss in qml?

    3
    0 Votes
    3 Posts
    1k Views
    M
    Thank you very much! This is better solutions from this that I saw before!
  • How to use ScrollView properly?

    5
    0 Votes
    5 Posts
    8k Views
    O
    bq. Only one Item can be a direct child of the ScrollView and the child is implicitly anchored to fill the scroll view. It looks like we should have it done it like: @ScrollView { Rectangle { Layout.minimumWidth: 200 Layout.maximumHeight: 100 color: "#565656" Column { id: kik anchors.fill: parent Text {text:"ahoj"} Text {text:"ahoj"} Text {text:"ahoj"} Text {text:"ahoj"} Text {text:"ahoj"} } } }@
  • SQLITE out of memory Unable to execute statement problem [SOLVED]

    7
    0 Votes
    7 Posts
    9k Views
    O
    [quote author="majidkhalili" date="1392472478"]Dorod bar shoma that clear thing worked :D thanks a lot ;)[/quote] You're welcome, glad i could help you. [quote author="majidkhalili" date="1392472578"]i don't know how to mark this post as solved , or how to thank to u by sths like voting up or sty like that ?!!![/quote] Just edit your main post, the one above every post. You'll find the edit button on the right side of your post. Then add [Solved] to your Title(It would be more visible in front of the Title.). There are no votes or something like that in qt-project.org. A 'thank you' at all is more than enough. :)
  • Best option for 3D Viewer in Qt 5.0

    5
    0 Votes
    5 Posts
    3k Views
    O
    Great work! I'll check it out later. :)
  • How to use QML Camera image in c++ code

    4
    0 Votes
    4 Posts
    4k Views
    L
    I want to process every frame of the camera video, how to do that @mbrasser.
  • Can we change a rootcontext ?

    7
    0 Votes
    7 Posts
    2k Views
    O
    Alright, good luck and keep us and this thread up to date, thank you. :)
  • 0 Votes
    7 Posts
    2k Views
    O
    Well actually it should update automatically. You could try to use a QQuickView instead of the qtquick2applicationviewer. Maybe it'll work with it.
  • Passing QLists to QML

    16
    0 Votes
    16 Posts
    7k Views
    H
    So far I see only two ways to handle this: you can use something like @ Q_PROPERTY(QQmlListPropertyYourNameSpace::YourCustomType nameOfList READ nameOfList) @ instead of a Q_PROPERTY with a QList. Therefore you need to register your custom type with @ qmlRegisterTypeYourNameSpace::YourCustomType("Name_you_reference_in_QML", majorversionnumber, minorversionnumber, "QMLNameWhateverNeededFor"); @ And you have to register the class holding the list with setContextProperty. This QQmlListProperty introduces an extra way for the QML side to access the data in your model. But that doesn't work just out the box (again), you have to write extra functions to get/set the data from/into the list (yes, you keep the QList and must add extra functions, e.g. see QQmlListProperty::AppendFunction. What have we got here? A model has been changed (or maybe even polluted if you want), we added all that Q_PROPERTY stuff and the extra functions. IMHO that is ugly. You see the C++ and QML worlds as what they are: 2 different worlds with totally different approaches, object models and data types that need a translator for every communication between the two worlds. They are aliens. From this point of view an adapter pattern would come in handy and I think that's the way to look at all the variations of AbstractItem... models. Those are somehow like the guys with the white flag that transport messages between two parties at war. But this comes at the price that you have to write a lot of bolier plate code to fulfill the protocol both parties have agreed about: the interface functions. IMHO ugly, again. But the model can stay untouched, at least this feels better for me! Either way: more work, both not perfect. Strange when you think about where Qt came from: it originated as C++ framework that enabled you to write UIs with C++ (and yes, there were also AbstractItem... models). My problem is not so much that the UI has to written in QML, that's totally fine. I totally understand why they did it: each new platform and each change in an already supported platform introduced a huge amount of work. This work was transferred to the developer that uses the framework. This developer has to adapt the look and feel of the platform (if there is no library available that does that for you), but from a good starting position and with quite good tools. The point I can't understand is, that they somehow "forgot" an easy and universal way (in the sense of just a few lines of code or even better: no code at all) to get data in and out. Some say it's for your own good: a clean separation of ui and logic. To me it's like someone is saying "we found out that we gave you a hammer and you treated every problem as a nail". And then "our solution is: you keep the nails, we take away the hammer and give you a screwdriver instead". Ah, BTW: you can write Javascript inside QML, so much for separation of UI and logic. So now I took this thread as far off topic as possible and yes it's opinionated:-)
  • QtQuick 2.0 doesn't supported by Qt Designer in 5.2.1

    2
    0 Votes
    2 Posts
    892 Views
    O
    Could you provide us your Cpp code(Especially where the View is)? Could you try it with QtQuick 2.0?