Revert "chore: avoid use screenAt(QCursor::pos())"
I actually forgot why I did this, I might thought this API
is deprecated?
Reverting this resolved the issue that window is not appeared
at the screen that currently the cursor is at.
This reverts commit 4375fe1c2d.
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 = window()->screen()->availableSize();
|
||||
QSize screenSize = qApp->screenAt(QCursor::pos())->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(),
|
||||
window()->screen()->availableGeometry()
|
||||
qApp->screenAt(QCursor::pos())->availableGeometry()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user