diff options
| author | 2016-09-25 09:59:40 +0200 | |
|---|---|---|
| committer | 2016-09-25 09:59:40 +0200 | |
| commit | e225f2edfd365d1709df2cb5bb2f752ec8d82c1c (patch) | |
| tree | 865b4d676b328fb2391d544d72617bbab855472e /mobile | |
| parent | 48d672116d58e44159de3bbd5f1366b16fb7f704 (diff) | |
| download | OneRoll-e225f2edfd365d1709df2cb5bb2f752ec8d82c1c.tar.gz OneRoll-e225f2edfd365d1709df2cb5bb2f752ec8d82c1c.zip | |
add file for mobile application
Diffstat (limited to 'mobile')
| -rw-r--r-- | mobile/deployment.pri | 13 | ||||
| -rw-r--r-- | mobile/main.qml | 172 | ||||
| -rw-r--r-- | mobile/mobile.pro | 20 | ||||
| -rw-r--r-- | mobile/mobile.qrc | 5 | ||||
| -rw-r--r-- | mobile/qml.qrc | 6 | ||||
| -rw-r--r-- | mobile/qml/main.qml | 17 |
6 files changed, 233 insertions, 0 deletions
diff --git a/mobile/deployment.pri b/mobile/deployment.pri new file mode 100644 index 0000000..265ce71 --- /dev/null +++ b/mobile/deployment.pri @@ -0,0 +1,13 @@ +unix:!android { + isEmpty(target.path) { + qnx { + target.path = /tmp/$${TARGET}/bin + } else { + target.path = /opt/$${TARGET}/bin + } + export(target.path) + } + INSTALLS += target +} + +export(INSTALLS) diff --git a/mobile/main.qml b/mobile/main.qml new file mode 100644 index 0000000..700f3a7 --- /dev/null +++ b/mobile/main.qml @@ -0,0 +1,172 @@ +import QtQuick 2.7 +import QtQuick.Window 2.2 + +Window { + id:root + visible: true + signal addRoll(string name, string cmd ) + signal roll(string cmd) + color: "black" + height: 1280 + width: 720 + + Column{ + + anchors.fill: parent + leftPadding: width*0.025 + rightPadding: width*0.025 + topPadding: width*0.025 + Rectangle { + height: parent.height*0.12 + width: parent.width*0.95 + Image { + anchors.fill: parent + horizontalAlignment: Image.AlignHCenter + verticalAlignment:Image.AlignVCenter + fillMode: Image.PreserveAspectFit + source: "qrc:/resources/images/add.png" + } + gradient: Gradient { + GradientStop { position: 0.0; color: "darkblue" } + GradientStop { position: 1.0; color: "blue" } + } + MouseArea { + anchors.fill: parent + onClicked:popupAdd.visible = true + } + } + + ListView { + model: _model + focus: true + height: parent.height*0.88 + width: parent.width*0.95 + delegate: Item{ + height: parent.height + width: parent.width + Column{ + width: parent.width + height: parent.height + Text{ + text: name + font.pointSize: 40 + color: "white" + + + } + Text{ + text: cmd + font.pointSize:30 + color: "white" + + } + } + MouseArea{ + anchors.fill:parent + onClicked: roll(cmd) + } + } + } + + } + Rectangle { + id: popupAdd + color: "black" + x: parent.width*0.1 + y: parent.height*0.1 + height: parent.height*0.80 + width: parent.width*0.80 + visible: false + border.color: "white" + border.width: 1 + + Column{ + id:form + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: parent.height*0.80 + leftPadding: width*0.025 + rightPadding: width*0.025 + topPadding: width*0.025 + property alias name : nameInp + property alias cmd : cmdInp + Text { + text: qsTr("Name") + color: "white" + height: parent.height*0.1 + font.pointSize: 40 + } + Rectangle{ + height: parent.height*0.1 + width: parent.width*0.90 + border.color: "#BBBBBB" + border.width: 1 + color: "black" + TextInput{ + id: nameInp + color: "white" + anchors.fill: parent + font.pointSize: 40 + } + } + + Text { + text: qsTr("Command") + color: "white" + height: parent.height*0.1 + font.pointSize: 40 + } + Rectangle{ + height: parent.height*0.1 + width: parent.width*0.90 + border.color: "#BBBBBB" + border.width: 1 + color: "black" + TextInput{ + id: cmdInp + color: "white" + anchors.fill: parent + font.pointSize: 40 + } + } + } + + Rectangle { + color:"red" + id: cancel + anchors.top: form.bottom + anchors.left: form.left + anchors.right: form.horizontalCenter + anchors.bottom: parent.bottom + radius: height/2 + MouseArea { + anchors.fill: parent + onClicked:{ + nameInp.text="" + cmdInp.text="" + popupAdd.visible = false + } + } + } + Rectangle { + color:"green" + anchors.top: form.bottom + anchors.left: cancel.right + anchors.right: form.right + anchors.bottom: parent.bottom + radius: height/2 + MouseArea { + anchors.fill: parent + onClicked: + { + root.addRoll(nameInp,cmdInp.text); + nameInp.text="" + cmdInp.text="" + popupAdd.visible = false + } + } + + } + } +} diff --git a/mobile/mobile.pro b/mobile/mobile.pro new file mode 100644 index 0000000..2e33522 --- /dev/null +++ b/mobile/mobile.pro @@ -0,0 +1,20 @@ +TEMPLATE = app + +QT += qml quick +CONFIG += c++11 + +SOURCES += main.cpp maincontroler.cpp \ + commandmodel.cpp + +HEADERS += maincontroler.h \ + commandmodel.h + +RESOURCES += qml.qrc + +include(../diceparser.pri) + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Default rules for deployment. +include(deployment.pri) diff --git a/mobile/mobile.qrc b/mobile/mobile.qrc new file mode 100644 index 0000000..69145a8 --- /dev/null +++ b/mobile/mobile.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>qml/main.qml</file> + </qresource> +</RCC> diff --git a/mobile/qml.qrc b/mobile/qml.qrc new file mode 100644 index 0000000..2cbbe08 --- /dev/null +++ b/mobile/qml.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>resources/images/add.png</file> + </qresource> +</RCC> diff --git a/mobile/qml/main.qml b/mobile/qml/main.qml new file mode 100644 index 0000000..ed9d480 --- /dev/null +++ b/mobile/qml/main.qml @@ -0,0 +1,17 @@ +import QtQuick 2.4 + +Item { + id:root + + ListView { + id: diceList + } + + Item{ + id: popupInput + + } + Item { + id: popupResult + } +} |