Should I prefer QML over plain C++?



  • Hello. I need to redesign my desktop software (like new Reload version) and I'm a bit confused. New GUIs provided by UI/UX designer need animations and opacity/position animations.
    First version of my program uses only QT Designer created forms with QSS for style handling. So, please give me advise, should I prefer QML for animations/transitions/UI, or hardcode it in some way in QT Designer/Sources?
    What are pros and cons using both methods (QML vs C++) to handle animations?



  • QML are very efficient when it comes to update a scene frame after frame to produce a smooth animation. QML has a issue where it must resolve dynamic types or create data-structures to represent property bindings and go through the Qt meta object type system to access any native member.

    Almost all of which C++ performs equivalently at compile time. As long as you create QML's that can be accomplished with asynchronous Loaders or by pre-loading components it shouldn't matter.



  • Is it complicated to rework project from simple C++ + QT Designer designed forms to QML-based GUI? Should I need to use other IDEs/Editors to work with QML?

    Sorry for idiot question, but is QML a QT's implementation of MVC idiom?



  • @b2soft QML is a declarative language which is easier to do animations than Qt Widgets class related with pictures and animations.

    QML has a strong relation with Qt Core classes... but I'm not sure about any relation to MVC... I'll bet there is none.

    Kind Regards,

    Carlos


  • Moderators

    @b2soft said in Should I prefer QML over plain C++?:

    Is it complicated to rework project from simple C++ + QT Designer designed forms to QML-based GUI?

    Depends. With QML you can't use Qt Widgets but you'll use QtQuick Controls instead. They are quite feature complete but not as full-blown complete as Qt Widgets. If you have a simple GUI already then it will be easy to port it to QML. If you have custom Widgets then you'll have to reimplement them in QML first.



  • @Wieland I use only simple labels/etc stuff stylized using QSS. There are no custom widgets at all.
    Thanks for answers!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.