From 9ac85f82078e96689b95e22f56306f1f1f91522b Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 16 Sep 2016 16:58:08 +0200 Subject: add file --- mobile/CMakeLists.txt | 101 +++++++++++++++++++++++++++++++++++++++++++++++ mobile/main.cpp | 54 +++++++++++++++++++++++++ mobile/maincontroler.cpp | 7 ++++ mobile/maincontroler.h | 17 ++++++++ mobile/mainwindow.cpp | 6 +++ mobile/mainwindow.h | 17 ++++++++ 6 files changed, 202 insertions(+) create mode 100644 mobile/CMakeLists.txt create mode 100644 mobile/main.cpp create mode 100644 mobile/maincontroler.cpp create mode 100644 mobile/maincontroler.h create mode 100644 mobile/mainwindow.cpp create mode 100644 mobile/mainwindow.h (limited to 'mobile') diff --git a/mobile/CMakeLists.txt b/mobile/CMakeLists.txt new file mode 100644 index 0000000..12e629a --- /dev/null +++ b/mobile/CMakeLists.txt @@ -0,0 +1,101 @@ +cmake_minimum_required(VERSION 2.8) + +option(UPDATE_TRANSLATIONS "update Translation" OFF) +MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}") + + +project(diceGui) + + +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Instruct CMake to run moc automatically when needed. +set(CMAKE_AUTOMOC ON) + +# Find the QtWidgets library +find_package(Qt5 COMPONENTS Quick Qml Core Widgets Gui) +#find_package(Qt5QuickCompiler) + +set(EXECUTABLE_OUTPUT_PATH bin/) + +include_directories(${Qt5Core_INCLUDES} ${Qt5Widgets_INCLUDES} ${Qt5Gui_INCLUDES} ${Qt5Qml_INCLUDES} ${Qt5Quick_INCLUDES}../) +add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Qml_DEFINITIONS} ${Qt5Quick_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ) + +ADD_DEFINITIONS( + -std=c++11 +) + +set(diceGui_RESOURCES diceparser.qrc) +FIND_PACKAGE(Qt5LinguistTools) + + +IF(UPDATE_TRANSLATIONS) + MESSAGE( update Translation ) + FILE(GLOB_RECURSE translate_diceGui_SRCS ../*.cpp ../*.h) + SET(translate_SRCS ${translate_dice_SRCS}) + SET(diceGui_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/diceGui_en.ts" "${CMAKE_CURRENT_SOURCE_DIR}/i18n/diceGui_fr.ts") +ELSE() + MESSAGE( NO updates for translations) + FILE(GLOB diceGui_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/*.ts") +ENDIF(UPDATE_TRANSLATIONS) + +if(Qt5Core_FOUND) + + IF(UPDATE_TRANSLATIONS) + MESSAGE(status "find" ${diceGui_TS} ${translate_SRCS} ) + QT5_CREATE_TRANSLATION(diceGui_QM ${translate_SRCS} ${diceGui_TS}) + ELSE() + QT5_ADD_TRANSLATION(diceGui_QM ${diceGui_TS}) + ENDIF() + + QT5_ADD_RESOURCES(diceGui_RESOURCES_RCC ${diceGui_RESOURCES}) + + # guess plugins and libraries directory + set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins") + get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION) + get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) +endif() + +SET( diceGui_sources + ../diceparser.cpp + ../range.cpp + ../booleancondition.cpp + ../validator.cpp + ../compositevalidator.cpp + ../operationcondition.cpp + ../die.cpp + ../parsingtoolbox.cpp + ../dicealias.cpp + ../result/result.cpp + ../result/scalarresult.cpp + ../result/stringresult.cpp + ../result/diceresult.cpp + ../node/countexecutenode.cpp + ../node/dicerollernode.cpp + ../node/executionnode.cpp + ../node/explosedicenode.cpp + ../node/helpnode.cpp + ../node/mergenode.cpp + ../node/jumpbackwardnode.cpp + ../node/keepdiceexecnode.cpp + ../node/listaliasnode.cpp + ../node/listsetrollnode.cpp + ../node/numbernode.cpp + ../node/parenthesesnode.cpp + ../node/paintnode.cpp + ../node/rerolldicenode.cpp + ../node/scalaroperatornode.cpp + ../node/sortresult.cpp + ../node/startingnode.cpp + ../node/ifnode.cpp + main.cpp + maincontroler.cpp + ../highlightdice.cpp +) + +add_executable( diceGui ${diceGui_sources} ${diceGui_QM} ) + +target_link_libraries(diceGui ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Quick_LIBRARIES}) +INSTALL_TARGETS(/bin diceGui) + +#qt5_use_modules() diff --git a/mobile/main.cpp b/mobile/main.cpp new file mode 100644 index 0000000..b450d5a --- /dev/null +++ b/mobile/main.cpp @@ -0,0 +1,54 @@ +/*************************************************************************** +* Copyright (C) 2016 by Renaud Guezennec * +* http://www.rolisteam.org/contact * +* * +* This file is part of DiceParser * +* * +* DiceParser is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ + + + + + +#include +#include + +/** + * @page DiceGui + * The QML client for DiceParser the new dice system from rolisteam. + * It is dedicated to be used on smartphone. + * @section Build and install + * To build this program, type these command: + * - mkdir build + * - cd build + * - cmake ../ + * - make + * - make install + * @return + */ +int main(int argc, char *argv[]) +{ + QApplication app(argc,argv); + QApplication::setApplicationName("dice"); + QApplication::setApplicationVersion("1.0"); + + QQuickWindow* m_window; + + + + return 0; +} diff --git a/mobile/maincontroler.cpp b/mobile/maincontroler.cpp new file mode 100644 index 0000000..d6197e1 --- /dev/null +++ b/mobile/maincontroler.cpp @@ -0,0 +1,7 @@ +#include "maincontroler.h" + +MainControler::MainControler(QObject *parent) + : QObject(parent) +{ + +} diff --git a/mobile/maincontroler.h b/mobile/maincontroler.h new file mode 100644 index 0000000..98d68ff --- /dev/null +++ b/mobile/maincontroler.h @@ -0,0 +1,17 @@ +#ifndef MAINCONTROLER_H +#define MAINCONTROLER_H + +#include + +class MainControler : public QObject +{ + Q_OBJECT +public: + explicit MainControler(QObject *parent = 0); + +signals: + +public slots: +}; + +#endif // MAINCONTROLER_H diff --git a/mobile/mainwindow.cpp b/mobile/mainwindow.cpp new file mode 100644 index 0000000..ec0bd08 --- /dev/null +++ b/mobile/mainwindow.cpp @@ -0,0 +1,6 @@ +#include "mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ + +} diff --git a/mobile/mainwindow.h b/mobile/mainwindow.h new file mode 100644 index 0000000..df67bfe --- /dev/null +++ b/mobile/mainwindow.h @@ -0,0 +1,17 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit MainWindow(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // MAINWINDOW_H \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 9de995b43dceae701b579e12753203a438895970 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 25 Sep 2016 04:17:32 +0200 Subject: -Add stuff for mobile application. --- mobile/commandmodel.cpp | 25 +++++++++++++++++++++++++ mobile/commandmodel.h | 31 +++++++++++++++++++++++++++++++ mobile/resources/images/add.png | Bin 0 -> 4612 bytes 3 files changed, 56 insertions(+) create mode 100644 mobile/commandmodel.cpp create mode 100644 mobile/commandmodel.h create mode 100644 mobile/resources/images/add.png (limited to 'mobile') diff --git a/mobile/commandmodel.cpp b/mobile/commandmodel.cpp new file mode 100644 index 0000000..1f6f6e1 --- /dev/null +++ b/mobile/commandmodel.cpp @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (C) 2016 by Renaud Guezennec * + * http://www.rolisteam.org/contact * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "commandmodel.h" + +CommandModel::CommandModel() +{ + +} diff --git a/mobile/commandmodel.h b/mobile/commandmodel.h new file mode 100644 index 0000000..e68c91e --- /dev/null +++ b/mobile/commandmodel.h @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (C) 2016 by Renaud Guezennec * + * http://www.rolisteam.org/contact * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef COMMANDMODEL_H +#define COMMANDMODEL_H + +#include + +class CommandModel : public QAbstractListModel +{ +public: + CommandModel(); +}; + +#endif // COMMANDMODEL_H \ No newline at end of file diff --git a/mobile/resources/images/add.png b/mobile/resources/images/add.png new file mode 100644 index 0000000..9d63dc4 Binary files /dev/null and b/mobile/resources/images/add.png differ -- cgit v1.2.3-70-g09d2 From 664ac48622701dedaa816f5c27fff5f99389690e Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 25 Sep 2016 04:19:05 +0200 Subject: -first draft of mobile application. --- mobile/CMakeLists.txt | 3 +- mobile/commandmodel.cpp | 32 +++++++++++++++++ mobile/commandmodel.h | 17 ++++++++- mobile/main.cpp | 75 ++++++++++++++++------------------------ mobile/maincontroler.cpp | 30 ++++++++++++++++ mobile/maincontroler.h | 11 ++++++ mobile/resources/images/add.png | Bin 4612 -> 4696 bytes 7 files changed, 121 insertions(+), 47 deletions(-) (limited to 'mobile') diff --git a/mobile/CMakeLists.txt b/mobile/CMakeLists.txt index 12e629a..0ccff18 100644 --- a/mobile/CMakeLists.txt +++ b/mobile/CMakeLists.txt @@ -92,8 +92,9 @@ SET( diceGui_sources maincontroler.cpp ../highlightdice.cpp ) +qt5_add_resources(RESOURCE_ADDED mobile.qrc) -add_executable( diceGui ${diceGui_sources} ${diceGui_QM} ) +add_executable( diceGui ${diceGui_sources} ${diceGui_QM} ${RESOURCE_ADDED} ) target_link_libraries(diceGui ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Quick_LIBRARIES}) INSTALL_TARGETS(/bin diceGui) diff --git a/mobile/commandmodel.cpp b/mobile/commandmodel.cpp index 1f6f6e1..6a3ab1d 100644 --- a/mobile/commandmodel.cpp +++ b/mobile/commandmodel.cpp @@ -23,3 +23,35 @@ CommandModel::CommandModel() { } + +QVariant CommandModel::data(const QModelIndex &index, int role) const +{ + QPair indexP = m_data.at(index.row()); + if(role == NameRole) + { + return indexP.first; + } + else if(role == CmdRole) + { + return indexP.second; + } +} + +int CommandModel::rowCount(const QModelIndex &parent) const +{ + return m_data.count(); +} +QHash CommandModel::roleNames() const +{ + QHash roles; + roles[NameRole] = "name"; + roles[CmdRole] = "cmd"; + return roles; +} +void CommandModel::insertCmd(QString name, QString cmd) +{ + QModelIndex index; + beginInsertRows(index,0,0); + m_data.prepend(QPair(name,cmd)); + endInsertRows(); +} diff --git a/mobile/commandmodel.h b/mobile/commandmodel.h index e68c91e..2c20072 100644 --- a/mobile/commandmodel.h +++ b/mobile/commandmodel.h @@ -22,10 +22,25 @@ #include +#include + class CommandModel : public QAbstractListModel { + Q_OBJECT public: + enum CustomRole {NameRole = Qt::UserRole+1,CmdRole}; CommandModel(); + + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole ) const; + virtual int rowCount(const QModelIndex &parent) const; + + QHash roleNames() const; + + +public slots: + void insertCmd(QString name, QString cmd); +private: + QList > m_data; }; -#endif // COMMANDMODEL_H \ No newline at end of file +#endif // COMMANDMODEL_H diff --git a/mobile/main.cpp b/mobile/main.cpp index b450d5a..c4c8b0a 100644 --- a/mobile/main.cpp +++ b/mobile/main.cpp @@ -1,54 +1,39 @@ /*************************************************************************** -* Copyright (C) 2016 by Renaud Guezennec * -* http://www.rolisteam.org/contact * -* * -* This file is part of DiceParser * -* * -* DiceParser is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ + * Copyright (C) 2016 by Renaud Guezennec * + * http://www.rolisteam.org/contact * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include + +#include "maincontroler.h" - - - - -#include -#include - -/** - * @page DiceGui - * The QML client for DiceParser the new dice system from rolisteam. - * It is dedicated to be used on smartphone. - * @section Build and install - * To build this program, type these command: - * - mkdir build - * - cd build - * - cmake ../ - * - make - * - make install - * @return - */ int main(int argc, char *argv[]) { - QApplication app(argc,argv); - QApplication::setApplicationName("dice"); - QApplication::setApplicationVersion("1.0"); + QGuiApplication app(argc, argv); + + MainControler* main = new MainControler(); - QQuickWindow* m_window; + QQmlApplicationEngine engine; + main->initEngine(&engine); + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + //main->setConnections(&engine); - return 0; + return app.exec(); } diff --git a/mobile/maincontroler.cpp b/mobile/maincontroler.cpp index d6197e1..4b40fa2 100644 --- a/mobile/maincontroler.cpp +++ b/mobile/maincontroler.cpp @@ -1,7 +1,37 @@ #include "maincontroler.h" +#include +#include + MainControler::MainControler(QObject *parent) : QObject(parent) { + m_model = new CommandModel(); + m_model->insertCmd("L5R","8D10e10k4"); + + m_diceParser = new DiceParser(); +} +void MainControler::initEngine(QQmlApplicationEngine* engine) +{ + m_engine = engine; + engine->rootContext()->setContextProperty("_model",m_model); + connect(m_engine,SIGNAL(objectCreated(QObject*,QUrl)),this,SLOT(setConnections(QObject*,QUrl))); + + +} +void MainControler::rollDice(QString cmd) +{ + if(m_diceParser->parseLine(cmd)) + { + m_diceParser->Start(); + qDebug() << m_diceParser->getSumOfDiceResult(); + } +} +void MainControler::setConnections(QObject* root,QUrl url) +{ + //QObject* root = engine->rootContext()->contextObject(); + + connect(root,SIGNAL(roll(QString)),this,SLOT(rollDice(QString))); + connect(root,SIGNAL(addRoll(QString,QString)),m_model,SLOT(insertCmd(QString,QString))); } diff --git a/mobile/maincontroler.h b/mobile/maincontroler.h index 98d68ff..b94312d 100644 --- a/mobile/maincontroler.h +++ b/mobile/maincontroler.h @@ -2,6 +2,10 @@ #define MAINCONTROLER_H #include +#include + +#include "commandmodel.h" +#include "diceparser.h" class MainControler : public QObject { @@ -9,9 +13,16 @@ class MainControler : public QObject public: explicit MainControler(QObject *parent = 0); + void initEngine(QQmlApplicationEngine* ); signals: public slots: + void setConnections(QObject* root,QUrl url); + void rollDice(QString cmd); +private: + CommandModel* m_model; + DiceParser* m_diceParser; + QQmlApplicationEngine* m_engine; }; #endif // MAINCONTROLER_H diff --git a/mobile/resources/images/add.png b/mobile/resources/images/add.png index 9d63dc4..c8e1bd2 100644 Binary files a/mobile/resources/images/add.png and b/mobile/resources/images/add.png differ -- cgit v1.2.3-70-g09d2 From e225f2edfd365d1709df2cb5bb2f752ec8d82c1c Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 25 Sep 2016 09:59:40 +0200 Subject: add file for mobile application --- mobile/deployment.pri | 13 ++++ mobile/main.qml | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++ mobile/mobile.pro | 20 ++++++ mobile/mobile.qrc | 5 ++ mobile/qml.qrc | 6 ++ mobile/qml/main.qml | 17 +++++ 6 files changed, 233 insertions(+) create mode 100644 mobile/deployment.pri create mode 100644 mobile/main.qml create mode 100644 mobile/mobile.pro create mode 100644 mobile/mobile.qrc create mode 100644 mobile/qml.qrc create mode 100644 mobile/qml/main.qml (limited to 'mobile') 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 @@ + + + qml/main.qml + + 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 @@ + + + main.qml + resources/images/add.png + + 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 + } +} -- cgit v1.2.3-70-g09d2