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. Best structure for mixed Qml/C++ app?
Forum Updated to NodeBB v4.3 + New Features

Best structure for mixed Qml/C++ app?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 2 Posters 1.2k Views 2 Watching
  • 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.
  • P Offline
    P Offline
    patrickkidd
    wrote on last edited by
    #1

    I have an application that I want to run on desktop and tablet/mobile (prioritizing macOS/iOS). The main view is already written in QGraphicsView and the property sheets are written as QWidgets, and it is nearing release on macOS. It appears that I at least need to re-write the property sheets in QtQuick to get hardware acceleration and better touch compatibility on mobile. There are two main views - file browser (currently QListView) with two tabs and a QGraphicsView which slides over the file browser and contains many QWidget property sheets as child widgets.

    What is the best way to structure this app for Qml/iOS? Qml containing the QGraphicsView? Just re-write the property sheets in Qml and embed them in C++? What are the considerations here?

    Thanks!

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The only way I am aware of to mix QtWidgets in QtQuick is KDAB's DeclarativeWidgets project. However I don't remember whether QGraphicsView is already supported. Note that you can do it the other way around using QQuickWidget.

      As for your current development, what would be good to start with is separate all the "backend" code so that you can easily change the UI on top of it.

      Since you are developing both for desktop and mobile, you should take the time to analyse whether the UI you have on your desktop machine can really translate as is on your mobile device screen. You may have to adapt some things and maybe completely change others. What goes well on a 27" screen won't on a 5.8" even if they are at the same resolution.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        The only way I am aware of to mix QtWidgets in QtQuick is KDAB's DeclarativeWidgets project. However I don't remember whether QGraphicsView is already supported. Note that you can do it the other way around using QQuickWidget.

        As for your current development, what would be good to start with is separate all the "backend" code so that you can easily change the UI on top of it.

        Since you are developing both for desktop and mobile, you should take the time to analyse whether the UI you have on your desktop machine can really translate as is on your mobile device screen. You may have to adapt some things and maybe completely change others. What goes well on a 27" screen won't on a 5.8" even if they are at the same resolution.

        P Offline
        P Offline
        patrickkidd
        wrote on last edited by
        #3

        @SGaist Are you suggesting that the most typical or at least most sensical approach is to have a top-level QWidgets app and embed the QtQuick components within it, as opposed to the other way around?

        https://alaskafamilysystems.com/

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Not at all. Since you were talking about having QtWidgets inside your QtQuick GUI, I just wanted to state what was available.

          As I wrote before, QtQuick was not written to embed QtWidgets, hence my suggestion of taking a look at DeclarativeWidgets.

          But again, please take the time to design your application so it fits in your smaller screen.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            patrickkidd
            wrote on last edited by
            #5

            Sorry if I didn't word it properly, but I was asking 1) whether QtQuick containing QWidgets was more appropriate than QWidgets containing QtQuick, and 2) if there were any other broader considerations I would have related to mixing these two, for example loss of hardware acceleration or functionality.

            It sounds like you are implying that QWidgets containing QtQuick is really the way to do this.

            That said, are there any other broader considerations I would have related to mixing these two, for example loss of hardware acceleration or functionality? Any other strategies I should be aware of?

            https://alaskafamilysystems.com/

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6
              1. Technically, until KDAB wrote DeclarativeWidgets, you didn't had a choice. So right now: you should test
              2. QtQuick requires OpenGL while QtWidgets not (unless you are using QOpenGLWidget)

              Again, no I'm not implying anything. I gave you the available options. My main message is: make it so that changing your UI is easy and do some design and testing because of the screen constraints.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • P Offline
                P Offline
                patrickkidd
                wrote on last edited by
                #7

                It sounds like people don’t do this very often then?

                https://alaskafamilysystems.com/

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Mixing Qt widgets and Qt quick on a mobile device ?

                  I don't know but I would be surprised.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  P 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Mixing Qt widgets and Qt quick on a mobile device ?

                    I don't know but I would be surprised.

                    P Offline
                    P Offline
                    patrickkidd
                    wrote on last edited by
                    #9

                    @SGaist on mobile and/or desktop.

                    You would be surprised if it was common or surprised if it was uncommon?

                    https://alaskafamilysystems.com/

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      I would be surprised if it was common on mobile. I can't say for desktop. It depends on what type of application you write and your target OS/Device.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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