Bring Window to the 2nd Monitor
Unsolved
QML and Qt Quick
-
wrote 14 days ago last edited by
I have 2 Monitors and want to put a Window to let's say Monitor 2. The following Example works perfect compiled with Qt 5.15.2. The window appears on the monitor I defined. But with Qt 6.7.3 it always appears on the Monitor I started the Application from.
(Using Rocky 9.4 Linux, Gnome 40.4, Wayland)import QtQuick 2.15 import QtQuick.Window 2.15 Window { screen: Qt.application.screens[1] // Monitor to show Window x: screen.virtualX y: screen.virtualY width: 640 height: 480 visible: true title: qsTr("Hello World") }
-
wrote 6 days ago last edited by
In the meantime I have found a workaround which only works for full screen.
Window { width: 640 height: 480 visible: false title: qsTr("Hello World") //x: 0 // Show on left Monitor x: 2000 // Show on right Monitor Component.onCompleted: { showFullScreen() // show Window on left or right Monitor (depending on x) //showMaximized() // shows window always on Monitor where I started the app //showNormal() // shows window always on Monitor where I started the app //show() // shows window always on Monitor where I started the app } }
(Same on RockyLinux 9.5 and Qt 6.8.3)