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



  • 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.