From af64f953d4f01a7c7bd3415ff5edfff8d4f7c48d Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Tue, 6 Oct 2015 12:52:40 +0200 Subject: Initial commit --- qml/main.qml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 qml/main.qml (limited to 'qml/main.qml') diff --git a/qml/main.qml b/qml/main.qml new file mode 100644 index 0000000..3e84b29 --- /dev/null +++ b/qml/main.qml @@ -0,0 +1,58 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Window 2.2 +import QtQuick.Dialogs 1.2 + +ApplicationWindow { + title: qsTr("Hello OpenGL in QML World") + width: 480 + height: 800 + visible: true + //set color to transparent, if you want to draw under QML-Items + //color: "transparent" + + + menuBar: MenuBar { + Menu { + title: qsTr("&File") + MenuItem { + text: qsTr("&Open") + onTriggered: messageDialog.show(qsTr("Open action triggered")); + } + MenuItem { + text: qsTr("E&xit") + onTriggered: Qt.quit(); + } + } + } + + MainForm { + anchors.fill: parent + + button1.onClicked: toggleMove() + onMovementActivatedChanged: + { + if(movementActivated) + { + button1.text = "Stop" + } + else + { + button1.text = "Start" + } + } + + button2.onClicked: messageDialog.show(qsTr("Button 2 pressed")) + button3.onClicked: messageDialog.show(qsTr("Button 3 pressed")) + } + + MessageDialog { + id: messageDialog + title: qsTr("May I have your attention, please?") + + function show(caption) { + messageDialog.text = caption; + messageDialog.open(); + } + } +} -- cgit v1.2.3-70-g09d2