Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81374

QDockWidget: Invert drag modifier key behavior (dock if <CTRL> pressed)

    XMLWordPrintable

Details

    • All

    Description

      What happens today (Qt 5.12.6 + 5.14):
      When you click-drag a floating QDockWidget around any QMainWindow for the app, it will attempt to dock the widget as you float over the different DockWidgetAreas of the main window (it will resize widgets in the main window, showing a placeholder where your dockwidget would dock to if you release the mouse button).

      To avoid this behavior today, you can press and hold <CTRL> before you click to drag the position of the floating QDockWidget. The result is that you can reposition the QDockWidget floating window without affecting the QMainWindow - the QMainWindow will not resize it's contents to show the different DockWidgetAreas, and if you release the window anywhere, it will not dock with any QMainWindow.


      Some users may wish to favor not having the QDockWindow dock. To address this I am suggesting that the <CTRL> modifier behavior be inverted.

      How this would act with the inversion would then be:

      • Dragging a floating QDockWidget window around a QMainWindow would not attempt to dock the widget as you float over the different DockWidgetAreas. Drag as you like, when you release, it would not dock.
      • Pressing and holding <CTRL> before clicking (for improvement to this see suggestion QTBUG-81372 ), then click-dragging the QDockWidget window and dragging around the QMainWindow would attempt to dock the widget as you float over the different DockWidgetAreas. Releasing would complete the dock action.

      I realize that this would be a departure from a long-standing feature, so I would also propose that this is paired with a settable flag controlling this behavior. By default <CTRL> would be used to suppress docking. Toggling the default value of the flag would then enable this inverted behavior.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              kkyzivat Keith Kyzivat
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes