Starting to use qtquick and qml from an existing Qt Gui Application

  • I have a Qt Gui Application for android that is using widgets for the current ui and I was wondering what would be the best way to change to using QtQuick and qml for the ui? I dont want to create a new project I just want to change the ui. Thank you!

  • Qt Champions 2017

    There is not direct way to change your widget to QML ui. You need to code it separately.

  • @Dheerendra this I know. I was wandeing how to get qml code to run under android that I could call from the existing program to use the qml as the ui instead of the widgets.

  • Moderators


    I recommend creating a new Qt Project for Android, and then studying the files that are auto-generated for you. After that,

    Back up your old project

    Copy the files from the new project into your old project

    Merge the new .pro file with your old .pro file

    Merge the new main() function into your old main() function -- replace QApplication (this is for QWidgets) with QGuiApplication (this is for general GUIs)

    Reimplement your UI in the sample QML file

Log in to reply