diff options
author | Antti Hölttä <AHoelttae@luxoft.com> | 2018-12-19 15:14:15 +0100 |
---|---|---|
committer | Antti Hölttä <AHoelttae@luxoft.com> | 2019-03-18 16:37:19 +0100 |
commit | b75bb90ea3ab5babff80ef70f3ae526d7f5cc278 (patch) | |
tree | dd78e72e954a152ff389f2a8f9325d9e9a138c31 /DemoApplication/controls | |
parent | d40b79cb1d3304f113df3091662760f585ee389e (diff) |
Add dialog window to the demo program
Use 'p' key to open a dialog
Diffstat (limited to 'DemoApplication/controls')
-rw-r--r-- | DemoApplication/controls/MessageDialog.qml | 39 | ||||
-rw-r--r-- | DemoApplication/controls/qmldir | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/DemoApplication/controls/MessageDialog.qml b/DemoApplication/controls/MessageDialog.qml new file mode 100644 index 0000000..afb9ad7 --- /dev/null +++ b/DemoApplication/controls/MessageDialog.qml @@ -0,0 +1,39 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.4 +import QtQuick.Window 2.12 +import QtQuick.Layouts 1.3 +import controls 1.0 + +Window { + id: root + width: 300 + height: 150 + + ColumnLayout { + anchors.fill: parent + + Text { + Layout.alignment: Qt.AlignHCenter + text: "This is a dialog!" + } + + Row { + Layout.alignment: Qt.AlignHCenter + CNButton { + text: "Yes" + focus: true + onClicked: root.close() + } + CNButton { + text: "Whatever" + onClicked: root.close() + } + CNButton { + text: "No" + onClicked: root.close() + } + } + } + + +} diff --git a/DemoApplication/controls/qmldir b/DemoApplication/controls/qmldir index 554a44e..736988e 100644 --- a/DemoApplication/controls/qmldir +++ b/DemoApplication/controls/qmldir @@ -7,3 +7,4 @@ CNSwitch 1.0 CNSwitch.qml CNCheckBox 1.0 CNCheckBox.qml CNListView 1.0 CNListView.qml CNItemDelegate 1.0 CNItemDelegate.qml +MessageDialog 1.0 MessageDialog.qml |