Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Widgets in Qt Quick application



  • Hello to all. I tried to find this information in google, but I can’t find anything about that.
    I have qt quick app, and I need to add several modal windows with some table views. This tables are pretty simple, but I need to modify them from c++ code, but working with qml’s tableview component is pretty hard, it is more easier to use qtableview widget for me.
    So is there a way to create qt widgets modal window inside qt quick application?
    E.g. I am adding qt widgets form with .ui file and it’s class, then after clicking some button in qt quick window I am calling cpp function, that creates instance of that class and shows that form.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should take a look at KDAB's DeclarativeWidgets project.



  • @SGaist thank you a lot for your replay.
    The library you’ve mentioned allows to use qt widgets in qml, but for me it is more appropriate to create a class, inherited from QDialog and call exec(), but I can’t do that , because I don’t have QApplication lunched, is there a way to do that without external libraries?


  • Lifetime Qt Champion

    If you want to use widgets in your application you will need to have a QApplication instance in place of your QGuiApplication.

    As for no external libraries, you can but you will have to re-implement the concepts done in DeclarativeWidgets.



  • @SGaist Thank you a lot!


Log in to reply