
Originally Posted by
amleto
well, it kinda makes sense when you read:
“For an application, the screen where the main widget resides is the primary screen. This is stored in the primaryScreen property.â€
- Coises.
now you have to check that the sizes of the different screens always correspond correctly?
But then I should get different screen resolutions for the primary screen each time. But the following always returns "QRect(1024,0 1366x768)"...
QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen())
To copy to clipboard, switch view to plain text mode

Originally Posted by
Coises
Per ChrisW67’s suggestion, what happens if you replace
QApplication::desktop()->screenNumber() with
QApplication::desktop()->screenNumber(widget), where
widget is a pointer to your window widget? (See:
QDesktopWidget::screenNumber)
Similarly, note that
QDesktopWidget::availableGeometry can take a QWidget* argument.
Hm, when I try
QApplication::desktop()->screenNumber(this)
To copy to clipboard, switch view to plain text mode
I get a slightly different output to the qDebug() statement: "0 - 1 - 2". But again, it's the exact same no matter what screen I start the app on...
I'll have a look at QDesktopWidget::availableGeometry() later-on when I'm back home... hopefully that'll work!!
Bookmarks