Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Splash screen won't go away when the animation has completed.
Qt 6.12 LTS is out! See what's new in the release blog

Splash screen won't go away when the animation has completed.

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,
    I tried to add a basic splash screen to my app after a lot of messing about i got it kinda working.

    It has decided it won't bugger off and reveal the Webview, although it is still functioning behind the white screen.

    @import QtQuick 1.0
    import com.nokia.symbian 1.0
    import QtWebKit 1.0

    Window {
    id: window

    StatusBar {
        id: statusBar
        z: 0
        anchors.top: window.top
    }
    
    PageStack {
        id: pageStack
        anchors { left: parent.left; right: parent.right; top: statusBar.bottom; bottom: toolBar.top }
    }
    
    ToolBar {
        id: toolBar
        y: 580
        height: 46
        anchors.left: parent.left
        anchors.leftMargin: 0
        anchors.right: parent.right
        anchors.rightMargin: 0
        z: 3
        anchors.bottom: window.bottom
        tools: ToolBarLayout {
            id: toolBarLayout
            ToolButton {
                id: toolbutton1
    

    width: 360
    height: 46

                anchors.left: left
                anchors.leftMargin: 0
                flat: false
                   iconSource: "toolbar-back"
                onClicked: {
                    textfield1.visible=false
                    textfield1.text= web_view1.back
                    
                }
                onPlatformPressAndHold: pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
            }
    
    
            TextField {
                id: textfield1
                x: 60
                y: 10
                width: 240
                height: 0
                text: "http://"
                anchors.right: toolbutton2.left
                anchors.rightMargin: 0
                anchors.left: toolbutton1.right
                anchors.leftMargin: 0
                anchors.verticalCenter: parent.verticalCenter
                z: 3
            }
            ToolButton {
                id: toolbutton2
                x: 300
                y: 0
     width: 0
    

    height: 0

                anchors.right: parent.right
               anchors.rightMargin: 0
                iconSource: ""
                flat: true
                onPlatformPressAndHold: web_view1.forward
                onClicked: 
    

    {"<body style="background-color:WHITE"><B> <BR> <Font color = BLACK size = 4>"
    web_view1.url = textfield1.text

                }
            }
        }
      }
    ProgressBar {
        id: progressbar1
        y: 566
        height: 15
        anchors.left: parent.left
        anchors.leftMargin: 0
        anchors.right: parent.right
        anchors.rightMargin: 0
        anchors.bottom: toolBar.top
        anchors.bottomMargin: -6
        z: 1
        maximumValue: 1
        minimumValue: 0
        value: web_view1.progress
    }
    
    Flickable {
        id: flickable1
        anchors.right: parent.right
        anchors.rightMargin: 0
        anchors.left: parent.left
        anchors.leftMargin: 0
        anchors.bottom: progressbar1.top
        anchors.bottomMargin: -5
        anchors.top: statusBar.bottom
        anchors.topMargin: 0
        contentHeight: web_view1.height
        contentWidth: web_view1.width
        maximumFlickVelocity: 3000
        flickDeceleration: 1500
        boundsBehavior: "DragOverBounds"
        flickableDirection: Flickable.AutoFlickDirection
        //flickDeceleration: 01
        //maximumFlickVelocity: 1000
    

    Rectangle {
    width: 360; height: 640
    SplashScreen{
    id:splashScreen
    imageSource: "images/Splashicon.svg"
    anchors.fill: parent
    onSplashScreenCompleted: {
    // do whatever you want splash screen loaded completely
    console.log("Splash Screen Loaded");
    }
    }
    }

        WebView {
            id: web_view1
            x: 0
            y: 0
            //height: 545
            //width: 360
                url: "index.html";
            settings.offlineStorageDatabaseEnabled : true
            settings.offlineWebApplicationCacheEnabled : true
            settings.localStorageDatabaseEnabled : true
    
            preferredHeight: flickable1.height
            preferredWidth: flickable1.width
            visible: true
    
            onLoadStarted: {
                textfield1.visible = false
                //= "&lt;body style=\"background-color:WHITE\"&gt;&lt;B> <BR> <Font color = BLACK size = 4>"
        }
        }
    }
    
    Text {
        id: text1
        x: 5
        y: 0
        width: 38
        height: 26
        color: "#ffffff"
        text: Math.round(web_view1.progress*100) + "%"
        styleColor: "#9e9e9e"
        style: Text.Raised
        horizontalAlignment: Text.AlignLeft
        verticalAlignment: Text.AlignVCenter
        z: 5
        font.pixelSize: 15
    }
    
    Component.onCompleted: {
        pageStack.push(Qt.resolvedUrl("MainPage.qml"))
    }
    

    }

            @
    

    Any suggestions ?

    I'm a noob at qml so plz don't be too technical ;)

    Regards

    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
    • Unsolved