Qml 实现一个简单的SplashScreen

Splash.qml

import Qt 4.7 Item { width: parent.width height: parent.height Image { id: splash width: parent.width; height: parent.height source: "splash.png" clip: true // only makes a difference if mode is PreserveAspectCrop smooth: true opacity: 0.2 //running默认是false;这里PropertyAnimation显示过程中并不会阻塞parent组件中代码的执行 PropertyAnimation {id: splashAnimation; running: true; target: splash; property: "opacity"; to: 1.0; duration: 1000 } } }
【Qml 实现一个简单的SplashScreen】
main.qml

import Qt 4.7 Rectangle { id: rect width: 100; height: 100 Splash {} }

    推荐阅读