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. Docking QDockWidget to main window and on top of other widgets
Forum Updated to NodeBB v4.3 + New Features

Docking QDockWidget to main window and on top of other widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 3.5k 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
    Pauly
    wrote on last edited by
    #1

    When I create a QDockWidget that floats on top of other widgets, the dock widget is not attached to main window, as a result if the main window moves the dock widget does not move along.

    My overall plan is to create a button to hide/show the dock widget, as it floats on top of other widgets, it will not affect the view of everything else.

    Thanks.

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

      Hi
      Floating Docks are windows and they are not moved with mainwindow as they might be
      full screen or on another monitor so in most use cases it makes no sense to move with parent.

      Im not sure what your question is, if any ?

      P 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Floating Docks are windows and they are not moved with mainwindow as they might be
        full screen or on another monitor so in most use cases it makes no sense to move with parent.

        Im not sure what your question is, if any ?

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

        @mrjj said in Docking QDockWidget to main window and on top of other widgets:

        other monitor so in most use cases it makes no sense to move with p

        I see. I think my question would be how to make a QDockWidget sit on top of other widgets, in its docking mode and undocking mode... Thanks.

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

          Hi
          Im not sure what sit on top means.
          When in floating mode, its a window and not inside the main app.

          If you want to move the docks if mainwindow is dragged/moved then you need
          to override
          virtual void moveEvent ( QMoveEvent * event )
          (for mainwindow)

          and then manually adjust the docks you think is ok to move.

          P 1 Reply Last reply
          0
          • mrjjM mrjj

            Hi
            Im not sure what sit on top means.
            When in floating mode, its a window and not inside the main app.

            If you want to move the docks if mainwindow is dragged/moved then you need
            to override
            virtual void moveEvent ( QMoveEvent * event )
            (for mainwindow)

            and then manually adjust the docks you think is ok to move.

            P Offline
            P Offline
            Pauly
            wrote on last edited by
            #5

            @mrjj

            Sorry about the confusion... Let me try again...

            When I dock a QDockWidget to main window, other widgets in the main window will resize to fit with the QDockWidget so that there is no overlapping. I'd like to let the QDockWidget overlap other widgets (and be on top) so that when it docks, other widgets will not resize. What can I do? Thanks.

            mrjjM 1 Reply Last reply
            0
            • P Pauly

              @mrjj

              Sorry about the confusion... Let me try again...

              When I dock a QDockWidget to main window, other widgets in the main window will resize to fit with the QDockWidget so that there is no overlapping. I'd like to let the QDockWidget overlap other widgets (and be on top) so that when it docks, other widgets will not resize. What can I do? Thanks.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Pauly
              If i understand you correctly, i do not think its possible.
              http://doc.qt.io/qt-5/qmainwindow.html
              alt text

              It has areas to dock to, so im not sure how it could overlap other widgets already in
              the mainwindow.

              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