forked from zhengtianzuo/QtQuickExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.qml
More file actions
36 lines (33 loc) · 838 Bytes
/
main.qml
File metadata and controls
36 lines (33 loc) · 838 Bytes
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
/*!
*@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 QtQuick.Layouts 1.0
ApplicationWindow {
visible: true
width: 400
height: 300
title: qsTr("Qml选择开关")
Label{
id: label
anchors.bottom: qmlToggleButton.top
anchors.horizontalCenter: parent.horizontalCenter
height: 24
width: contentWidth
}
QmlToggleButton{
id: qmlToggleButton
anchors.centerIn: parent
height: 26
width: 80
leftString: qsTr("打开")
rightString: qsTr("关闭")
onToggleLeft: label.text = qmlToggleButton.leftString
onToggleRight: label.text = qmlToggleButton.rightString
}
}