File tree Expand file tree Collapse file tree 14 files changed +189
-0
lines changed Expand file tree Collapse file tree 14 files changed +189
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -------------------------------------------------
2
+ #
3
+ # Copyright (C) 2003-2103 CamelSoft Corporation
4
+ #
5
+ # -------------------------------------------------
6
+
7
+ QT += qml quick winextras
8
+
9
+ CONFIG += c++11
10
+
11
+ SOURCES += main.cpp
12
+
13
+ RESOURCES += qml.qrc
14
+
15
+ win32 {
16
+ RESOURCES += QmlWinExtras.qrc
17
+ RC_FILE = QmlWinExtras.rc
18
+ }
Original file line number Diff line number Diff line change
1
+ <RCC>
2
+ <qresource prefix="/">
3
+ <file>logo.ico</file>
4
+ <file>QmlWinExtras.rc</file>
5
+ </qresource>
6
+ </RCC>
7
+
Original file line number Diff line number Diff line change
1
+ #include "winver.h"
2
+
3
+ IDI_ICON1 ICON DISCARDABLE "logo.ico"
4
+
5
+ VS_VERSION_INFO VERSIONINFO
6
+ FILEVERSION 1,0,0,0
7
+ PRODUCTVERSION 1,0,0,0
8
+ FILEFLAGS 0x0L
9
+ FILEFLAGSMASK 0x3fL
10
+ FILEOS 0x00040004L
11
+ FILETYPE 0x1L
12
+ FILESUBTYPE 0x0L
13
+ BEGIN
14
+ BLOCK "StringFileInfo"
15
+ BEGIN
16
+ BLOCK "080404b0"
17
+ BEGIN
18
+ VALUE "CompanyName", "zhengtianzuo"
19
+ VALUE "FileDescription", "QmlWinExtras"
20
+ VALUE "FileVersion", "1.0.0.0"
21
+ VALUE "InternalName", "QmlWinExtras.exe"
22
+ VALUE "LegalCopyright", "Copyright (C) 2003-2103 CamelSoft Corporation"
23
+ VALUE "OriginalFilename","QmlWinExtras.exe"
24
+ VALUE "ProductName", "QmlWinExtras"
25
+ VALUE "ProductVersion", "1.0.0.0"
26
+ END
27
+ END
28
+ BLOCK "VarFileInfo"
29
+ BEGIN
30
+ VALUE "Translation", 0x0804, 1200
31
+ END
32
+ END
Original file line number Diff line number Diff line change
1
+ /* !
2
+ *@file main.cpp
3
+ *@brief 程序主文件
4
+ *@version 1.0
5
+ *@section LICENSE Copyright (C) 2003-2103 CamelSoft Corporation
6
+ *@author zhengtianzuo
7
+ */
8
+ #include < QGuiApplication>
9
+ #include < QQmlApplicationEngine>
10
+ #include < QtWinExtras>
11
+
12
+ int main (int argc, char *argv[])
13
+ {
14
+ QCoreApplication::setAttribute (Qt::AA_EnableHighDpiScaling);
15
+ QGuiApplication app (argc, argv);
16
+
17
+ QQmlApplicationEngine engine;
18
+ engine.load (QUrl (QLatin1String (" qrc:/main.qml" )));
19
+
20
+ return app.exec ();
21
+ }
Original file line number Diff line number Diff line change
1
+ /*!
2
+ *@file main.qml
3
+ *@brief 主文件
4
+ *@version 1.0
5
+ *@section LICENSE Copyright (C) 2003-2103 CamelSoft Corporation
6
+ *@author zhengtianzuo
7
+ */
8
+ import QtQuick 2.7
9
+ import QtQuick.Controls 2.0
10
+ import QtWinExtras 1.0
11
+
12
+ ApplicationWindow {
13
+ visible: true
14
+ width: 400
15
+ height: 300
16
+ title: qsTr (" QmlWinExtras" )
17
+
18
+ TaskbarButton {
19
+ property real proValue: 0
20
+ property alias interval: timer .interval
21
+
22
+ function isRunning (){
23
+ return (timer .running )
24
+ }
25
+
26
+ function onStart (){
27
+ taskbar .proValue = 0 ;
28
+ timer .running = true ;
29
+ }
30
+
31
+ function onStop (){
32
+ timer .running = false ;
33
+ }
34
+
35
+ id: taskbar
36
+ overlay .iconSource : " qrc:/logo.ico"
37
+ overlay .accessibleDescription : qsTr (" 加载中..." )
38
+ progress .visible : (progress .value != 0 )
39
+ progress .value : taskbar .proValue
40
+
41
+ Timer{
42
+ id: timer
43
+ running: false
44
+ repeat: true
45
+ interval: 20
46
+ onTriggered: {
47
+ taskbar .proValue ++ ;
48
+ if (taskbar .proValue > 100 ){
49
+ taskbar .onStop ();
50
+ return ;
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ Button{
57
+ id: btnTaskbar
58
+ height: 24
59
+ width: 120
60
+ anchors .centerIn : parent
61
+ text: taskbar .isRunning () ? qsTr (" 结束" ) : qsTr (" 开始" )
62
+ onClicked: {
63
+ if (taskbar .isRunning ()){
64
+ taskbar .onStop ();
65
+ }else {
66
+ taskbar .onStart ();
67
+ }
68
+ }
69
+ }
70
+
71
+ ThumbnailToolBar {
72
+ ThumbnailToolButton {
73
+ iconSource: " qrc:/Chat_MsgRecordG.svg"
74
+ tooltip: qsTr (" 消息" )
75
+ }
76
+ ThumbnailToolButton {
77
+ iconSource: " qrc:/Chat_FriendManagerG.svg"
78
+ tooltip: qsTr (" 联系人" )
79
+ }
80
+ ThumbnailToolButton {
81
+ iconSource: " qrc:/Mobile_FindG.svg"
82
+ tooltip: qsTr (" 发现" )
83
+ }
84
+ ThumbnailToolButton {
85
+ iconSource: " qrc:/Main_P2PChatG.svg"
86
+ tooltip: qsTr (" 我" )
87
+ onClicked: {
88
+ Qt .quit ()
89
+ }
90
+ }
91
+ }
92
+ }
Original file line number Diff line number Diff line change
1
+ <RCC>
2
+ <qresource prefix="/">
3
+ <file>main.qml</file>
4
+ <file>Chat_FriendManagerG.svg</file>
5
+ <file>Chat_MsgRecordG.svg</file>
6
+ <file>Main_P2PChatG.svg</file>
7
+ <file>Mobile_FindG.svg</file>
8
+ </qresource>
9
+ </RCC>
Original file line number Diff line number Diff line change @@ -31,3 +31,4 @@ SUBDIRS += QmlFontList
31
31
SUBDIRS += QmlFlipImage
32
32
SUBDIRS += QmlGrayImage
33
33
SUBDIRS += QmlProgress
34
+ SUBDIRS += QmlWinExtras
Original file line number Diff line number Diff line change @@ -137,3 +137,8 @@ QmlProgress: Qml进度条
137
137
138
138
![ ] ( https://github.com/zhengtianzuo/QtQuickExamples/blob/master/QmlProgress/show.gif?raw=true )
139
139
140
+
141
+ QmlWinExtras: QmlWinExtras
142
+
143
+ ![ ] ( https://github.com/zhengtianzuo/QtQuickExamples/blob/master/QmlWinExtras/show.gif?raw=true )
144
+
You can’t perform that action at this time.
0 commit comments