Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Set Window start screen
Qt 6.11 is out! See what's new in the release blog

Set Window start screen

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brocan
    wrote on last edited by Brocan
    #1

    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.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Brocan
      wrote on last edited by
      #2

      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();
          }
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved