Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.13.2, 6.0
-
None
Description
It's not possible to compare the screen property of a Window with a screen from e.g. the Qt.application.screens array.
To reproduce, run the following example and move the window between two screens.
import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Window 2.12 ApplicationWindow { id: window width: 400 height: 400 visible: true onScreenChanged: print(screen, Qt.application.screens[0]) }
Even though they are the same screens, the QQuickScreenInfo objects are different. A workaround is to compare the names of the screen.
In addition, the screen property returns a new QQuickScreenInfo object each time it's called, which seems wasteful.