diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2022-09-19 16:50:37 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-22 10:25:31 +0000 |
commit | 1098778129b955091483a4c1d4a13b1ac1ea236a (patch) | |
tree | aa3925d0ca64e92496754e99f3c619216f9773ac /examples/widgets/draganddrop/dropsite | |
parent | bd14c12e283af8f9f4cb9548e9a335307d76f495 (diff) |
Prevent dock widget from resizing upon unplugging from main window
QDockWidgetLayoutState::itemRect() has been used to calculate a dock
widget's size when unplugging from the main window. This method is meant
to calculate the size of the rubber band, showing the dock widget's
dock area.
The rubber band is by QDockAreaLayout::sep wider (top or bottom dock)
or higher (left or right dock) than the respective dock widget. This is
to make sure the rubber band is never fully covered by the dock widget.
By wrongly using itemRect() also for the dock widget's size after
unplugging, the dock widget grows in size each time it is unplugged.
This patch passes an invalid QRect to QDockWidgetPrivate::unplug(), in
order to prevent resizing.
tst_QDockWidget::unplugAndResize() is extended to check size
consistency after unplugging (corrected for frame margins).
Fixes: QTBUG-106531
Change-Id: I1cf9f695691b0e165a5cb2881781602426e5d587
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 10a143ccd762c810f4096a5b2e986d16ea0107ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/widgets/draganddrop/dropsite')
0 files changed, 0 insertions, 0 deletions