Unsolved Set Window start screen
-
Added splash screen into application:
Loader { Window { id: splashscreen title: "Splash Screen" modality: Qt.ApplicationModal flags: Qt.SplashScreen x: (Screen.width - width) / 2 y: (Screen.height - height) / 2 ... } source: "appMainWindow.qml" //Window{...} asynchronous: true }
But if there are couple desktops, it's possible situation, when the splash screen appears on one, and the app screen on another.
I found possibility to set screen in QWindow class, but it's not applicable for using in QML. -
As not a very good decision I added such code into the loader:
onLoaded: { item.x = splashscreen.x - (item.width - splashscreen.width) / 2 item.y = splashscreen.y - (item.height - splashscreen.height) / 2 item.show() splashscreen.close(); }