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

QDockWidget Undocking incorrectly offset from cursor (native titlebar) when dragging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.4.1, 6.5.0 Beta1
    • 5.9, 5.15.2, 6.3.1, 6.4, 6.5
    • GUI: Drag and Drop
    • None
    • Windows 10 21H2.
    • Windows
    • d46f317c8e (qt/qtbase/dev) d46f317c8e (qt/tqtc-qtbase/dev) 41e488c2fc (qt/qtbase/6.4) 41e488c2fc (qt/tqtc-qtbase/6.4)

    Description

      When undocking a QDockWidget from a main window, the position of the dock relative to the cursor is offset from the top left of the widget, rather than the top left of the native window decorations.

      Before undocking:

      Once undocked:

       

      Notice the cursor is no longer over the titlebar, but displaying over the first row. The dock itself shifted up, whereas I actually dragged the dock downwards.

      Reproduced in Qt Creator's "Dock Widgets Example" example app for Qt 6.3.1. Verified on both Windows and macOS.

       

       

      Manually confirmed the issue did not exist in 5.7, but does in 5.9 and above. Looked through commits for qdockwidget and I believe it's caused by https://github.com/qt/qtbase/commit/99ce1d3d97c0423c3ee63ccf58deed964db0770e

      My personal guess is the commit does improve behaviour for custom titlebars (untested), but misbehaves with native decorations.

      Attachments

        Activity

          People

            axelspoerl Axel Spoerl
            wizardcm wizardcm
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: