-
Notifications
You must be signed in to change notification settings - Fork 487
/
main.qml
92 lines (83 loc) · 2.13 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*!
*@file main.qml
*@brief 主文件
*@version 1.0
*@section LICENSE Copyright (C) 2003-2103 CamelSoft Corporation
*@author zhengtianzuo
*/
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtWinExtras 1.0
ApplicationWindow {
visible: true
width: 400
height: 300
title: qsTr("QmlWinExtras")
TaskbarButton {
property real proValue: 0
property alias interval: timer.interval
function isRunning(){
return(timer.running)
}
function onStart(){
taskbar.proValue = 0;
timer.running = true;
}
function onStop(){
timer.running = false;
}
id: taskbar
overlay.iconSource: "qrc:/logo.ico"
overlay.accessibleDescription: qsTr("加载中...")
progress.visible: (progress.value != 0)
progress.value: taskbar.proValue
Timer{
id: timer
running: false
repeat: true
interval: 20
onTriggered:{
taskbar.proValue++;
if (taskbar.proValue > 100){
taskbar.onStop();
return;
}
}
}
}
Button{
id: btnTaskbar
height: 24
width: 120
anchors.centerIn: parent
text: taskbar.isRunning() ? qsTr("结束") : qsTr("开始")
onClicked: {
if (taskbar.isRunning()){
taskbar.onStop();
}else{
taskbar.onStart();
}
}
}
ThumbnailToolBar {
ThumbnailToolButton {
iconSource: "qrc:/Chat_MsgRecordG.svg"
tooltip: qsTr("消息")
}
ThumbnailToolButton {
iconSource: "qrc:/Chat_FriendManagerG.svg"
tooltip: qsTr("联系人")
}
ThumbnailToolButton {
iconSource: "qrc:/Mobile_FindG.svg"
tooltip: qsTr("发现")
}
ThumbnailToolButton {
iconSource: "qrc:/Main_P2PChatG.svg"
tooltip: qsTr("我")
onClicked: {
Qt.quit()
}
}
}
}