chore: avoid use screenAt(QCursor::pos())
This commit is contained in:
@ -222,7 +222,7 @@ void MainWindow::adjustWindowSizeBySceneRect()
|
||||
|
||||
if (m_graphicsView->scaleFactor() < 1 || size().expandedTo(sceneSizeWithMargins) != size()) {
|
||||
// if it scaled down by the resize policy:
|
||||
QSize screenSize = qApp->screenAt(QCursor::pos())->availableSize();
|
||||
QSize screenSize = window()->screen()->availableSize();
|
||||
if (screenSize.expandedTo(sceneSize) == screenSize) {
|
||||
// we can show the picture by increase the window size.
|
||||
QSize finalSize = (screenSize.expandedTo(sceneSizeWithMargins) == screenSize) ?
|
||||
@ -584,7 +584,7 @@ void MainWindow::centerWindow()
|
||||
Qt::LeftToRight,
|
||||
Qt::AlignCenter,
|
||||
this->size(),
|
||||
qApp->screenAt(QCursor::pos())->availableGeometry()
|
||||
window()->screen()->availableGeometry()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user