2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-11-18 09:32:56 +00:00
|
|
|
|
2021-02-09 17:06:54 +00:00
|
|
|
import QtQuick
|
2021-08-27 14:19:54 +00:00
|
|
|
import shared
|
2011-11-18 09:32:56 +00:00
|
|
|
|
2013-03-08 15:44:52 +00:00
|
|
|
//! [splash-properties]
|
2012-11-05 10:16:14 +00:00
|
|
|
Window {
|
2013-05-29 08:58:38 +00:00
|
|
|
id: splash
|
2013-03-08 15:44:52 +00:00
|
|
|
color: "transparent"
|
|
|
|
title: "Splash Window"
|
|
|
|
modality: Qt.ApplicationModal
|
|
|
|
flags: Qt.SplashScreen
|
2013-05-29 08:58:38 +00:00
|
|
|
property int timeoutInterval: 2000
|
|
|
|
signal timeout
|
2013-03-08 15:44:52 +00:00
|
|
|
//! [splash-properties]
|
|
|
|
//! [screen-properties]
|
|
|
|
x: (Screen.width - splashImage.width) / 2
|
|
|
|
y: (Screen.height - splashImage.height) / 2
|
|
|
|
//! [screen-properties]
|
2013-07-11 08:58:16 +00:00
|
|
|
width: splashImage.width
|
|
|
|
height: splashImage.height
|
2013-03-08 15:44:52 +00:00
|
|
|
|
|
|
|
Image {
|
|
|
|
id: splashImage
|
2021-08-27 14:19:54 +00:00
|
|
|
source: Images.qtLogo
|
2023-05-16 16:16:38 +00:00
|
|
|
TapHandler {
|
|
|
|
onTapped: splash.exit()
|
2013-03-08 15:44:52 +00:00
|
|
|
}
|
2011-11-18 09:32:56 +00:00
|
|
|
}
|
2023-05-16 16:16:38 +00:00
|
|
|
|
|
|
|
function exit() {
|
|
|
|
splash.visible = false
|
|
|
|
splash.timeout()
|
|
|
|
}
|
|
|
|
|
2013-03-08 15:44:52 +00:00
|
|
|
//! [timer]
|
|
|
|
Timer {
|
2023-05-16 16:16:38 +00:00
|
|
|
interval: splash.timeoutInterval; running: splash.visible; repeat: false
|
|
|
|
onTriggered: splash.exit()
|
2011-11-18 09:32:56 +00:00
|
|
|
}
|
2013-03-08 15:44:52 +00:00
|
|
|
//! [timer]
|
2011-11-18 09:32:56 +00:00
|
|
|
}
|