Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QDialog or a QMainWindow from qml
Forum Update on Monday, May 27th 2025

QDialog or a QMainWindow from qml

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 894 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi, is there a way to create a QDialog or a QMainWindow from qml?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    J.HilkJ 1 Reply Last reply
    0
    • mrdebugM mrdebug

      Hi, is there a way to create a QDialog or a QMainWindow from qml?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @mrdebug
      sure

      https://doc.qt.io/qt-5/qml-qtquick-controls2-dialog.html
      https://doc.qt.io/qt-5/qml-qtquick-controls2-applicationwindow.html


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by
        #3

        Sorry but I haven't explained so good.
        I have a qml application and I need to show a QWidget in a separate window.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        J.HilkJ 1 Reply Last reply
        0
        • IntruderExcluderI Offline
          IntruderExcluderI Offline
          IntruderExcluder
          wrote on last edited by
          #4

          You can call from QML any C++ backend function that creates QWindow or QDialog from widgets part, just do not forget that it requeres widgets module and also your application should be created as QApplication rather than QGuiApplication.

          1 Reply Last reply
          1
          • mrdebugM mrdebug

            Sorry but I haven't explained so good.
            I have a qml application and I need to show a QWidget in a separate window.

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @mrdebug
            additionally to @IntruderExcluder 's suggestion,
            KDAB has an "experimental" declarative widgets project, that might be of interest
            https://www.kdab.com/declarative-widgets/


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            1
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by
              #6

              At the end I have rewritten the project using a normal QMainWindow object with a QQuickWidget object in it so I can use both qml and qwidgets objects

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved