qt5base-lts/tests/auto/widgets/kernel
Axel Spoerl 5edb71c6d4 Fix QWidget::restoreGeometry when restored geometry is off screen
If a widget's geometry is restored to a screen, which is smaller than
the one it was saved from,
- the widget could appear (partly) off screen
- the widget's title bar and resize handles could be inaccessible

This patch refactors and documents checkRestoredGeometry.
In a first step, the restored geometry's size is checked against
a given screen size. It is corrected if necessary.
In a second step, the restored geometry is moved inside the screen,
if necessary.
It makes the function a static member of QWidgetPrivate in order to
expose it for auto testing and adds a respective test function to
tst_QWidget.

Fixes: QTBUG-77385
Fixes: QTBUG-4397
Task-number: QTBUG-69104
Pick-to: 6.5 6.4
Change-Id: I7172e27bfef86d82cd51de70b40de42e8895bae6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-16 22:58:11 +01:00
..
qaction Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qactiongroup Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qapplication Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qboxlayout Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qformlayout Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qgesturerecognizer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qgridlayout Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qlayout Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qshortcut Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qsizepolicy Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstackedlayout Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtooltip Deprecate QApplication::setActiveWindow() and mark as internal 2022-08-27 20:22:29 +02:00
qwidget Fix QWidget::restoreGeometry when restored geometry is off screen 2022-12-16 22:58:11 +01:00
qwidget_window Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qwidgetaction Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qwidgetmetatype Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qwidgetrepaintmanager Stabilize tst_QWidgetRepaintManager on XCB platforms 2022-11-30 14:48:51 +01:00
qwidgetsvariant Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qwindowcontainer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00