Desktop application with qml



  • Hi,
    We need to create a desktop application. We need to customize the UI too. Can any one suggest what we can use to implement our application. Qt Quick (with qml) or qwidget desktop application. Is it an invalid implementation if we use Qt Quick (qml) for desktop application?

    Thanks & Regards
    Tirupathi


  • Moderators

    @Tirupathi-Korla Why should it be invalid to use QtQuick for a desktop application?
    You can use both QtWidgets and QML/QtQuick. QML/QtQuick is more customizable, but there is a bit of work if you want to write some parts of the app in C++.



  • Yes, you sure can - I use c++, quick, widgets, controls2 & charts for a very nice combination.

    Self-critically... my code ranges from some very neat and performance oriented in some places, some not so much to nearly adverse in others... I still cannot believe how hard I push this.

    Some of the abuse I do would certainly just not happen in .NET or Java land... even the scripting in my QML files is quicker to code and execute due to QT's declarative and event driven focus... no callbacks or timeouts mean only work that has to be done - is done - and only as required. I am still only on a single thread (not including any engine threads not started my me explicitly).

    I am very soon to cut my c++ engine out of my gui thread - I've almost reshuffled my codebase to have only QML exposed objects in the main thread - as of now everything happens on the GUI thread and it's truly stupid the amount of work I can do before seeing frames dip. I'm at that stage now but it really boggles my mind that I can do this on such low hardware.

    As usual there are bits you have to do yourself - there is a surprising amount you do not. You do, however, need to know something exists before you can take advantage of it... search the example applications for QML and you'll get some idea what is canned/off shelf http://doc.qt.io/qtcreator/creator-build-example-application.html

    Being declarative and event driven is a big plus. I'm frequently uncovering greatness hidden inside States, Transitions and Behaviors. I just discovered http://doc.qt.io/qt-5/qml-qtquick-rotationanimation.html today... still being surprised with just how much script work I can ditch in favor of using these components instead. Much easier to maintain and often similar or better performance.

    I find working with the system often performs quicker and subtle things can make a big difference - it helps to be aware of http://doc.qt.io/qt-5/qtquick-performance.html - some very simple practices can help a lot.


Log in to reply
 

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