Unsolved Multithread in animation
-
I'm coding a program that contains a large amount of QPropertyAnimation. But I found that when too much QPropertyAnimation shows simultaneously, gui will be very laggy. Can I move all the Animaiton to another thread?
-
@Isolde No, you can't as all UI related classes may only be accessed from GUI thread.
-
If you really need a very animated GUI, you should consider using QML.
-
@mrjj For my edification (I don't use QML), why is that, please?
-
@JNBarchan
Basically its new way of making GUI.
You make the interface in descriptive language ( a bit json like )
and use javascript to tie the elements together. ( like button that hides element etc)
You can then use c++ as backend for calculations/models/data handling.
Its HW accelerated and very dynamic.http://doc.qt.io/qt-5/qtqml-index.html
If you want to test drive it, i found
https://qmlbook.github.io/
to good for an overview without digging deep into the Qt docs. -
@mrjj
Sorry, my question wasn't phrased as I intended. What I meant was: Why do you say:If you really need a very animated GUI, you should consider using QML
Why should QML be used for this?
(But thanks anyway for the QML summary.)
Ooohh:
Its HW accelerated
Is that why?
-
@JNBarchan
As widgets were not meant to do much animation. (even if possible)
QML on the other hand is like build for it and some of the Quick controls are
already animated. (like sliding pages etc)
QML would gladly support tons of animations as its powered by openGL
so yes thats mostly the reason. -
@mrjj Thank you very much, I'll have a try with QML.