Use QHighDpi::toNativeWindowGeometry()
This function implements the isTopLevel() logic, which we now don’t have to duplicate at each call site. Change-Id: Ic8b857aa7cd3c3c23d5e950d9f50b66c81ba3ccf Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
1afd562b0b
commit
46039092bd
@ -1753,13 +1753,7 @@ void QWindow::setGeometry(const QRect &rect)
|
||||
QScreen *newScreen = d->screenForGeometry(rect);
|
||||
if (newScreen && isTopLevel())
|
||||
d->setTopLevelScreen(newScreen, true);
|
||||
|
||||
QRect nativeRect;
|
||||
if (newScreen && isTopLevel())
|
||||
nativeRect = QHighDpi::toNativePixels(rect, newScreen);
|
||||
else
|
||||
nativeRect = QHighDpi::toNativeLocalPosition(rect, newScreen);
|
||||
d->platformWindow->setGeometry(nativeRect);
|
||||
d->platformWindow->setGeometry(QHighDpi::toNativeWindowGeometry(rect, this));
|
||||
} else {
|
||||
d->geometry = rect;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user