Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qwidgets
Forum Update on Monday, May 27th 2025

Qwidgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 1.4k 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.
  • A Offline
    A Offline
    AntiXeon
    wrote on last edited by
    #1

    Hi all,

    I'd like to draw widgets above a Qt3DWindow. The problem is that the window is always above any QWidget I add.

    I have embedded the Qt3DWindow into my GUI with QWidget::createWindowContainer(). So that is its inside a QWidget itself, and put into a QLayout. I have created a sibling QPushButton widget but this button can never be drawn above the "createWindowContainer" even when I use the raise(), lower() and even stackUnder() methods...

    I join a screenshot of the result, I have moved the 3D view to show the underlying button:
    0_1560855661424_Capture.PNG

    So, the question is: is it possible to draw QWidgets above a window with an OpenGL context?
    Should I instead use Qt3D to draw the GUI inside the window?

    Thank you for any answer! :)

    Pl45m4P 1 Reply Last reply
    0
    • A AntiXeon

      Hi all,

      I'd like to draw widgets above a Qt3DWindow. The problem is that the window is always above any QWidget I add.

      I have embedded the Qt3DWindow into my GUI with QWidget::createWindowContainer(). So that is its inside a QWidget itself, and put into a QLayout. I have created a sibling QPushButton widget but this button can never be drawn above the "createWindowContainer" even when I use the raise(), lower() and even stackUnder() methods...

      I join a screenshot of the result, I have moved the 3D view to show the underlying button:
      0_1560855661424_Capture.PNG

      So, the question is: is it possible to draw QWidgets above a window with an OpenGL context?
      Should I instead use Qt3D to draw the GUI inside the window?

      Thank you for any answer! :)

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @AntiXeon said in Qwidgets:

      createWindowContainer

      From Qt Doc:

      The window container has a number of known limitations:

      Stacking order:
      The embedded window will stack on top of the widget hierarchy as an opaque box. The stacking order of multiple**overlapping window container instances is undefined.

      I guess, you cant use "createWindowContainer" then... Is it necessary? Else I would put my 3D Widget into another container.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2
      • A Offline
        A Offline
        AntiXeon
        wrote on last edited by
        #3

        Thanks for your answer ! Shame on me, I missed this info from the documentation...

        I have a Qt3DWindow that has to be integrated into the general UI, as this kind of application:
        3D view in main window

        As far I know, there is only a Qt3DWindow to display a Qt3D scene? And the only way to include a view, like a Qt3DWindow is by using createWindowContainer. I do not know any other solution to perform the same using QWidgets.
        This limitation is quite annoying! :/

        Pl45m4P 1 Reply Last reply
        1
        • A AntiXeon

          Thanks for your answer ! Shame on me, I missed this info from the documentation...

          I have a Qt3DWindow that has to be integrated into the general UI, as this kind of application:
          3D view in main window

          As far I know, there is only a Qt3DWindow to display a Qt3D scene? And the only way to include a view, like a Qt3DWindow is by using createWindowContainer. I do not know any other solution to perform the same using QWidgets.
          This limitation is quite annoying! :/

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @AntiXeon

          As far as I understand it's only not possible to put something else (Button or whatever) in the same container as the Widget, because it will get covered by your 3D Widget.
          Never used 3D-Widgets before, but I think you can use another layout or container, so that other elements wont get covered


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AntiXeon
            wrote on last edited by
            #5

            Yes, the 3D widget is already in a vertical layout but the feature was to put widgets over it as in modern 3D softwares like this:
            Blender 2.8 UI
            I think we'll have to change the specifications!

            QtQuick can probably do this but the whole application is using C++ widgets, and we cannot spend time to develop a new UI.

            Thank you for your help!

            Pl45m4P 1 Reply Last reply
            0
            • A AntiXeon

              Yes, the 3D widget is already in a vertical layout but the feature was to put widgets over it as in modern 3D softwares like this:
              Blender 2.8 UI
              I think we'll have to change the specifications!

              QtQuick can probably do this but the whole application is using C++ widgets, and we cannot spend time to develop a new UI.

              Thank you for your help!

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by
              #6

              @AntiXeon

              Ok, so you want to literally draw over / inside the 3D Widget... I dont know if this is even possible. Maybe it can be done by subclassing / overriding Q3DWindow and creating a custom one for your purposes (may be a tough job, though) :)


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AntiXeon
                wrote on last edited by
                #7

                I think there is a last solution that can be interesting. :)
                Instead of directly integrate the Qt3DWindow in a widget, we could use a QtQuick view with "createWindowContainer".
                The QtQuick view embeds itself the 3D view and the QtQuick widgets, that are drawn over it as in this example.

                So that, the UI based on C++ widget is kept as is. We only have to use QtQuick components for this specific stuff, without having to develop a whole UI system with Qt3D.

                The last point to check is how to interact between QtQuick and the C++ application (events, etc). I haven't done big projects with QtQuick until now, all of them were pure QtQuick though. :o

                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