-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathmain.qml
109 lines (95 loc) · 4.08 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* author qyvlik
* email [email protected]
* time 2015/4/10
*/
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.3
import FlatUI 2.0
FlatMainWindow {
id:window;
objectName:"MainWindow"
title: qsTr("Flat Example Demo")
width: 960
height: 540
visible:true
// menuBar: MenuBar{
// Menu{
// title:"title"
// }
// }
contentControl.anchors.margins: 20
content: Flow{
id:flow
spacing: 10
FlatButton{ text:"AddTags"; onClicked: { __createExample(text)} }
FlatButton{ text:"CodeEditor"; onClicked: { __createExample(text)} }
FlatButton{ text:"RunningAppliction"; onClicked: { __createExample(text)} }
FlatButton{ text:"ShowMenuInWindow"; onClicked: { __createExample(text)} }
FlatButton{ text:"SampleVideoPlayer"; onClicked: { __createExample(text)} }
FlatButton{ text:"BaiduTranslate"; onClicked: { __createExample(text)} }
FlatButton{ text:"FBIWarning"; onClicked: { __createExample(text)} }
FlatButton{ text:"FloatingWindow"; onClicked: { __createExample(text)} }
FlatButton{ text:"WebBrowser"; onClicked:{ __createExample(text)}}
FlatButton{ text:"Test"; onClicked:{ __createExample(text)}}
FlatButton{ text:"StackViewDemo"; onClicked:{ __createExample(text)}}
FlatButton{ text:"WatchImageOnFullSceen"; onClicked:{ __createExample(text)}}
FlatButton{ text:"GroupBoxDemo"; onClicked:{ __createExample(text)}}
//![error ] Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly
FlatButton{ text:"ComboBoxDemo";type:FlatGlobal.typeDanger; onClicked:{ __createExample(text)}}
//![error ] Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly
FlatButton{ text:"HistorySearchDemo"; onClicked:{ __createExample(text)}}
FlatButton{ text:"ButtonType"; onClicked:{ __createExample(text)}}
FlatButton{ text:"YouTuBe"; onClicked:{ __createExample(text)}}
FlatButton{ text:"DoubanClient"; onClicked:{ __createExample(text)}}
FlatButton{ text:"SampleErrorExample"; type:FlatGlobal.typeDanger; onClicked:{ __createExample(text)}}
FlatButton{ text:"FormWindow"; type:FlatGlobal.typeInverse; onClicked:{ __createExample(text)}}
FlatButton{ text:"USBWebClient"; type:FlatGlobal.typeInverse; onClicked:{ __createExample(text)}}
//USBWebClient
FlatButton{ text:"about"; type: FlatGlobal.typeInfo; onClicked: aboutDialog.show()}
FlatButton{ text:"get a image"; type: FlatGlobal.typeWarning; onClicked: FlatGlobal.saveImageToFile(flow,"flow.png")}
}
ErrorDialog{ id:errorDialog; }
FlatDialog{
id:aboutDialog
width: 400
height: 300
title:"About FlatUI and QtQuick"
content:Item{
Column{
spacing:10
Text{
width: parent.width
anchors.margins: 10
wrapMode: Text.WordWrap
text:"look at http://www.bootcss.com/p/flat-ui/ and http://www.qt.io/"
font:FlatGlobal.font
}
Row{
spacing:10
FlatButton{
text:"look FlatUI"
onClicked: Qt.openUrlExternally("http://www.bootcss.com/p/flat-ui");
}
FlatButton{
text:"look QtQuick"
onClicked: Qt.openUrlExternally("http://www.qt.io");
}
}
}
}
}
function __createExample(exampleName){
var elementUrl = Qt.resolvedUrl(String("demo/"+exampleName+"/"+exampleName+".qml"));
var properties = {
x: window.x + 50,
y: window.y + 50
}
FlatGlobal.createQmlObjectFromUrl2(elementUrl, null,
properties, function(win){
win.show();
});
}
}