如何在QML应用中实现一个Splash画面
1个回答
2015-07-18
展开全部
import QtQuick 2.0
02.import Ubuntu.Components 1.1
03.
04./*!
05.rief MainView with a Label and Button elements.
06.*/
07.
08.MainView {
09.// objectName for functional testing purposes (autopilot-qt5)
10.objectName: "mainView"
11.
12.// Note! applicationName needs to match the "name" field of the click manifest
13.applicationName: "splashscreen.liu-xiao-guo"
14.
15./*
16.This property enables the application to change orientation
17.when the device is rotated. The default is false.
18.*/
19.//automaticOrientation: true
20.
21.// Removes the old toolbar and enables new features of the new header.
22.useDeprecatedToolbar: false
23.
24.width: units.gu(60)
25.height: units.gu(85)
26.
27.Page {
28.title: i18n.tr("Splashscreen")
29.
30.MainWindow {
31.id: mainwindow
32.anchors.fill: parent
33.visible: false
34.}
35.
36.SplashScreen {
37.onTimeout: {
38.console.log("it times out!");
39.mainwindow.visible = true;
40.}
41.}
42.}
43.}
02.import Ubuntu.Components 1.1
03.
04./*!
05.rief MainView with a Label and Button elements.
06.*/
07.
08.MainView {
09.// objectName for functional testing purposes (autopilot-qt5)
10.objectName: "mainView"
11.
12.// Note! applicationName needs to match the "name" field of the click manifest
13.applicationName: "splashscreen.liu-xiao-guo"
14.
15./*
16.This property enables the application to change orientation
17.when the device is rotated. The default is false.
18.*/
19.//automaticOrientation: true
20.
21.// Removes the old toolbar and enables new features of the new header.
22.useDeprecatedToolbar: false
23.
24.width: units.gu(60)
25.height: units.gu(85)
26.
27.Page {
28.title: i18n.tr("Splashscreen")
29.
30.MainWindow {
31.id: mainwindow
32.anchors.fill: parent
33.visible: false
34.}
35.
36.SplashScreen {
37.onTimeout: {
38.console.log("it times out!");
39.mainwindow.visible = true;
40.}
41.}
42.}
43.}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询