diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2022-09-19 16:50:37 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-09-21 18:41:43 +0000 |
commit | 10a143ccd762c810f4096a5b2e986d16ea0107ad (patch) | |
tree | 929c72ad710c996ce07a43ac44af2da3227ed141 /examples/widgets | |
parent | a8ccd9cd848be9aafd2d07d83a8897dc8b2a0cb3 (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
Pick-to: 6.4 6.2
Change-Id: I1cf9f695691b0e165a5cb2881781602426e5d587
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples/widgets')
0 files changed, 0 insertions, 0 deletions