AllScreens.qml Example File
window/AllScreens.qml
import QtQuick 2.3
import QtQuick.Window 2.3
import "../shared" as Shared
Column {
id: root
spacing: 8
Shared.Label {
text: "Total number of screens: " + screenInfo.count
font.bold: true
}
Flow {
spacing: 12
width: parent.width
Repeater {
id: screenInfo
model: Qt.application.screens
Shared.Label {
lineHeight: 1.5
text: name + "\n" + virtualX + ", " + virtualY + " " + modelData.width + "x" + modelData.height
}
}
}
Component.onCompleted: {
var screens = Qt.application.screens;
for (var i = 0; i < screens.length; ++i)
console.log("screen " + screens[i].name + " has geometry " +
screens[i].virtualX + ", " + screens[i].virtualY + " " +
screens[i].width + "x" + screens[i].height)
}
}