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/MainForm.ui.qml | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ qml/main.qml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 qml/MainForm.ui.qml create mode 100644 qml/main.qml (limited to 'qml') diff --git a/qml/MainForm.ui.qml b/qml/MainForm.ui.qml new file mode 100644 index 0000000..dbf5f4e --- /dev/null +++ b/qml/MainForm.ui.qml @@ -0,0 +1,56 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 +import MultiMediaProgrammierung 1.0 + +MMScene { + id: mainForm + width: 640 + height: 480 + + property alias button3: button3 + property alias button2: button2 + property alias button1: button1 + property alias buttonClose: buttonClose + + Rectangle{ + id: backgroundRect + anchors.fill: parent + color: "black" + } + + + + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: buttonClose.top + anchors.bottomMargin: 0 + + Button { + id: button1 + text: qsTr("Press Me 1") + } + + Button { + id: button2 + text: qsTr("Press Me 2") + } + + Button { + id: button3 + text: qsTr("Press Me 3") + } + } + + Button { + id: buttonClose + y: 453 + text: qsTr("Close") + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + } +} 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