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. Splash screen in QML
Forum Updated to NodeBB v4.3 + New Features

Splash screen in QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 959 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    Praveen.Illa
    wrote on last edited by
    #1

    Hi Team,

    I am new to Qt QML and trying to implement a splash screen in qml. But, I am getting a below error when running in eglfs instance.
    I have referred the below code from GIT and it was working good in x86 instance
    "EGLFS: OpenGL windows cannot be mixed with others."
    Could you please help me in resolving this.
    My code looks like

    main.qml

    Item {
        Loader {
            id: mainWindowLoader
            anchors.fill: parent
            visible: false
            source: "qrc:/window.qml"
            asynchronous: true
            onLoaded: {
                item.visible = true;
                splashScreenLoader.item.visible = false;
                splashScreenLoader.source = "";
            }
        }
    
        Loader {
            id: splashScreenLoader
            source: "qrc:/splashscreen.qml"
            anchors.fill: parent
            asynchronous: false
            onLoaded: {
                mainWindowLoader.active = true;
            }
        }
    }
    
    

    splashscreen.qml

    Window {
        id: splashScreen
        modality: Qt.ApplicationModal
        flags: Qt.SplashScreen
        width: 1024
        height: 600
    
    	Rectangle {
    		id: splashRect
    		anchors.fill: parent
    	        color: "white"
    		border.width: 1
    		border.color: "black"
    		
    		Text {
    			id: initializationErrorMessage
    			text: "This is the splash screen"
    			anchors.horizontalCenter: parent.horizontalCenter
    			anchors.top: parent.top
                           anchors.topMargin: 50
    			font.bold: true
    			font.pixelSize: 20
    			color: "black"
    		}
    	}
        Component.onCompleted: visible = true
    }
    
    

    window.qml

    ApplicationWindow {
    	id: mainWindow
        flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowCloseButtonHint
        width: 1024
        height: 600
    	visible: false
    	title: "Scresh Screen Test"
    
        Component.onCompleted: {
            var timeout = new Date().valueOf() + 3000;
            while(timeout > new Date().valueOf()) {}
        }
    
        Text {
            text: "Window ready!"
            anchors.centerIn: parent
            font.bold: true
            font.pixelSize: 20
            color: "black"
        }
    }
    
    raven-worxR 1 Reply Last reply
    0
    • P Praveen.Illa

      Hi Team,

      I am new to Qt QML and trying to implement a splash screen in qml. But, I am getting a below error when running in eglfs instance.
      I have referred the below code from GIT and it was working good in x86 instance
      "EGLFS: OpenGL windows cannot be mixed with others."
      Could you please help me in resolving this.
      My code looks like

      main.qml

      Item {
          Loader {
              id: mainWindowLoader
              anchors.fill: parent
              visible: false
              source: "qrc:/window.qml"
              asynchronous: true
              onLoaded: {
                  item.visible = true;
                  splashScreenLoader.item.visible = false;
                  splashScreenLoader.source = "";
              }
          }
      
          Loader {
              id: splashScreenLoader
              source: "qrc:/splashscreen.qml"
              anchors.fill: parent
              asynchronous: false
              onLoaded: {
                  mainWindowLoader.active = true;
              }
          }
      }
      
      

      splashscreen.qml

      Window {
          id: splashScreen
          modality: Qt.ApplicationModal
          flags: Qt.SplashScreen
          width: 1024
          height: 600
      
      	Rectangle {
      		id: splashRect
      		anchors.fill: parent
      	        color: "white"
      		border.width: 1
      		border.color: "black"
      		
      		Text {
      			id: initializationErrorMessage
      			text: "This is the splash screen"
      			anchors.horizontalCenter: parent.horizontalCenter
      			anchors.top: parent.top
                             anchors.topMargin: 50
      			font.bold: true
      			font.pixelSize: 20
      			color: "black"
      		}
      	}
          Component.onCompleted: visible = true
      }
      
      

      window.qml

      ApplicationWindow {
      	id: mainWindow
          flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowCloseButtonHint
          width: 1024
          height: 600
      	visible: false
      	title: "Scresh Screen Test"
      
          Component.onCompleted: {
              var timeout = new Date().valueOf() + 3000;
              while(timeout > new Date().valueOf()) {}
          }
      
          Text {
              text: "Window ready!"
              anchors.centerIn: parent
              font.bold: true
              font.pixelSize: 20
              color: "black"
          }
      }
      
      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Praveen-Illa
      EGLFS can only display a single window. thus your splash screen cannot be also a window.
      you must make it an Item and place it above the content of the mainwindow. E.g. as a child of the windows's overlay for example

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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