Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt5: Does QScreen::virtualSiblings() guarantee the order of screens (needed to detect current screen)?
eliseev last edited by
According to Qt5.0.0 documentation, screen returned by QWindow::screen() "does not change when the window is moved around virtual screen". That means, if QWindow is created on Display1 and then moved to Display2 - there is no way of telling it inside QWindow.
The QScreen class provides list of its virtual siblings, however documentation does not specify in what order these siblings are. Can I rely that top-left screen will be at  and bottom-right at [count()-1]? If so, I can take QWindow::position() and sum screens' dimensions until I find the current one (in usual case there are only two displays, but systems with more than two are not unthinkable of).
And this all is needed so call to showFullScreen() will expand the window onto current screen, not initial (primary?). Thus QWindow::setScreen() has to be called first with proper screen.
I reported https://bugreports.qt-project.org/browse/QTBUG-29252 and https://bugreports.qt-project.org/browse/QTBUG-29251 in connection with this issue.