QWidget::restoreGeometry(): Remove code related to restoredFrameGeometry
restoredFrameGeometry is only used for a sanity check in format version 0, add a comment and remove code. Task-number: QTBUG-76900 Change-Id: I797b07d069f8568cb39541bcbe9009935a4a79f7 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
parent
94570dc49a
commit
f66c22ff5b
@ -7505,7 +7505,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
|
||||
quint8 fullScreen;
|
||||
qint32 restoredScreenWidth = 0;
|
||||
|
||||
stream >> restoredFrameGeometry
|
||||
stream >> restoredFrameGeometry // Only used for sanity checks in version 0
|
||||
>> restoredNormalGeometry
|
||||
>> restoredScreenNumber
|
||||
>> maximized
|
||||
@ -7535,8 +7535,6 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
|
||||
}
|
||||
|
||||
const int frameHeight = 20;
|
||||
if (!restoredFrameGeometry.isValid())
|
||||
restoredFrameGeometry = QRect(QPoint(0,0), sizeHint());
|
||||
|
||||
if (!restoredNormalGeometry.isValid())
|
||||
restoredNormalGeometry = QRect(QPoint(0, frameHeight), sizeHint());
|
||||
@ -7556,17 +7554,9 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
|
||||
// - (Mac only) The window is higher than the available geometry. It must
|
||||
// be possible to bring the size grip on screen by moving the window.
|
||||
#if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||
restoredFrameGeometry.setHeight(qMin(restoredFrameGeometry.height(), availableGeometry.height()));
|
||||
restoredNormalGeometry.setHeight(qMin(restoredNormalGeometry.height(), availableGeometry.height() - frameHeight));
|
||||
#endif
|
||||
|
||||
if (!restoredFrameGeometry.intersects(availableGeometry)) {
|
||||
restoredFrameGeometry.moveBottom(qMin(restoredFrameGeometry.bottom(), availableGeometry.bottom()));
|
||||
restoredFrameGeometry.moveLeft(qMax(restoredFrameGeometry.left(), availableGeometry.left()));
|
||||
restoredFrameGeometry.moveRight(qMin(restoredFrameGeometry.right(), availableGeometry.right()));
|
||||
}
|
||||
restoredFrameGeometry.moveTop(qMax(restoredFrameGeometry.top(), availableGeometry.top()));
|
||||
|
||||
if (!restoredNormalGeometry.intersects(availableGeometry)) {
|
||||
restoredNormalGeometry.moveBottom(qMin(restoredNormalGeometry.bottom(), availableGeometry.bottom()));
|
||||
restoredNormalGeometry.moveLeft(qMax(restoredNormalGeometry.left(), availableGeometry.left()));
|
||||
|
Loading…
Reference in New Issue
Block a user