I wonder on which platform screen number maps to something useful?
Seems like unnecessary burden to maintain and allows people to write non-optimal code, e.g:
when a cleaner way exist (I have seen the above pattern in many places):
When we can add methods returning QScreen:
enabling developers to call ::availableGeometry() / ::screenGeometry() directly on QScreen? This gives access to more meaningful screen identifiers (compared to arbitrary screen numbers) - QScreen::model(), QScreen::name().
With these changes QDesktopWidget API would become very minimalistic (without loosing any of existing functionality), thus it might make sense to deprecate the whole class and move this tiny API over to QGuiApplication, which already has QScreen related methods, such as - ::primaryScreen(), ::screenAdded(), ::screenRemoved(), ::screens().
Furthermore, QDesktopWidget is a QWidget sub-class, so having this API in QGuiApplication would make it accessible to QML without widget dependency.
Bonus is that we could cleanup our code in various places from checks like ( .. != Qt::Desktop ), as it was necessary for QDesktopWidget purposes-only AFAICT.