HEADERS += \
src/models/client.h \
src/cm-lib_global.h \
- src/controllers/master-controller.h
+ src/controllers/master-controller.h \
+ src/controllers/navigation-controller.h
unix {
target.path = /usr/lib
#include "master-controller.h"
namespace cm::controllers {
-MasterController::MasterController(QObject *parent) : QObject(parent)
-{
-}
+ class MasterController::Implementation
+ {
+ public:
+ Implementation(MasterController* _masterController)
+ : masterController(_masterController)
+ {
+ navigationController = new NavigationController(_masterController);
+ }
+
+ MasterController* masterController{nullptr};
+ NavigationController* navigationController{nullptr};
+ QString welcomeMessage = "This is MasterController to Major Tom";
+ };
+
+ MasterController::MasterController(QObject *parent) : QObject(parent)
+ {
+ implementation.reset(new Implementation(this));
+ }
+
+ MasterController::~MasterController()
+ {
+
+ }
+
+ NavigationController* MasterController::navigationController()
+ {
+ return implementation->navigationController;
+ }
+
+ const QString& MasterController::welcomeMessage() const
+ {
+ return implementation->welcomeMessage;
+ }
}
#define MASTERCONTROLLER_H
#include <QObject>
+#include <QScopedPointer>
#include <QString>
-#include <cm-lib_global.h>
+#include "cm-lib_global.h"
+#include "controllers/navigation-controller.h"
namespace cm::controllers {
class CMLIBSHARED_EXPORT MasterController : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString ui_welcomeMessage MEMBER welcomeMessage CONSTANT)
+ Q_PROPERTY( QString ui_welcomeMessage READ welcomeMessage CONSTANT )
+ Q_PROPERTY( cm::controllers::NavigationController* ui_navigationController READ navigationController CONSTANT )
+
public:
explicit MasterController(QObject *parent = nullptr);
- QString welcomeMessage = "This is MasterController to Major Tom";
-
-signals:
+ ~MasterController();
+ NavigationController* navigationController();
+ const QString& welcomeMessage() const;
-public slots:
+private:
+ class Implementation;
+ QScopedPointer<Implementation> implementation;
};
}
--- /dev/null
+#ifndef NAVIGATIONCONTROLLER_H
+#define NAVIGATIONCONTROLLER_H
+
+#include <QObject>
+
+#include "cm-lib_global.h"
+#include "models/client.h"
+
+namespace cm::controllers {
+ class CMLIBSHARED_EXPORT NavigationController : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ explicit NavigationController(QObject* _parent = nullptr)
+ : QObject(_parent)
+ {}
+
+ signals:
+ void goCreateClientView();
+ void goDashboardView();
+ void goEditClientView(cm::models::Client* client);
+ void goFindClientView();
+
+ };
+}
+#endif // NAVIGATIONCONTROLLER_H
#include "client.h"
-
-Client::Client()
-{
+namespace cm::models {
+ Client::Client()
+ {
+ }
}
#include "cm-lib_global.h"
+namespace cm::models {
+
class CMLIBSHARED_EXPORT Client
{
public:
Client();
};
-
+}
#endif // CLIENT_H
QGuiApplication app(argc, argv);
qmlRegisterType<cm::controllers::MasterController>("CM", 1, 0, "MasterController");
+ qmlRegisterType<cm::controllers::NavigationController>("CM", 1, 0, "NavigationController");
cm::controllers::MasterController masterController;
QQmlApplicationEngine engine;
-import QtQuick 2.0
+import QtQuick 2.10
Item {
+ Rectangle {
+ anchors.fill: parent
+ color: "#f4c842"
+ Text {
+ anchors.centerIn: parent
+ text: "Create Client View"
+ }
+ }
}
-import QtQuick 2.0
+import QtQuick 2.10
Item {
+ Rectangle {
+ anchors.fill: parent
+ color: "#208010"
+ Text {
+ anchors.centerIn: parent
+ text: "Dashboard View"
+ }
+ }
}
-import QtQuick 2.0
+import QtQuick 2.10
Item {
+ Rectangle {
+ anchors.fill: parent
+ color: "#f4c842"
+ Text {
+ anchors.centerIn: parent
+ text: "Edit Client View"
+ }
+ }
}
-import QtQuick 2.0
+import QtQuick 2.10
Item {
+ Rectangle {
+ anchors.fill: parent
+ color: "#f4c842"
+ Text {
+ anchors.centerIn: parent
+ text: "Find Client View"
+ }
+ }
}
import QtQuick 2.10
import QtQuick.Window 2.10
+import QtQuick.Controls 2.2
Window {
visible: true
height: 480
title: qsTr("Client Management")
- Text {
- text: masterController.ui_welcomeMessage
+ Connections {
+ target: masterController.ui_navigationController
+ onGoCreateClientView: contentFrame.replace(Qt.resolvedUrl("qrc:/views/CreateClientView.qml"))
+ onGoDashboardView: contentFrame.replace(Qt.resolvedUrl("qrc:/views/DashboardView.qml"))
+ onGoEditClientView: contentFrame.replace(Qt.resolvedUrl("qrc:/views/EditClientView.qml"), { selectedClient: client })
+ onGoFindClientView: contentFrame.replace(Qt.resolvedUrl("qrc:/views/FindClientView.qml"))
}
+
+ Rectangle {
+ id: navigationBar
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ left: parent.left
+ }
+ width: 100
+ color:"#000000"
+ Column {
+
+ Button {
+ text: "Dashboard"
+ onClicked: masterController.ui_navigationController.goDashboardView()
+ }
+
+ Button {
+ text: "New Client"
+ onClicked: masterController.ui_navigationController.goCreateClientView()
+ }
+
+ Button {
+ text: "Find Client"
+ onClicked: masterController.ui_navigationController.goFindClientView()
+ }
+
+ }
+ }
+
+ StackView {
+ id: contentFrame
+ clip: true
+ anchors{
+ top: parent.top
+ left: navigationBar.right
+ bottom: parent.bottom
+ right: parent.right
+ }
+
+ initialItem: Qt.resolvedUrl("qrc:/views/SplashView.qml")
+ }
+
+ Component.onCompleted:
+ contentFrame.replace(Qt.resolvedUrl("qrc:/views/DashboardView.qml"))
}
-import QtQuick 2.0
+import QtQuick 2.10
Item {
+ Rectangle {
+ anchors.fill: parent
+ color: "#f4c842"
+ Text {
+ anchors.centerIn: parent
+ text: "Splash View"
+ }
+ }
}
}
PROCESSOR_x64 {
- processor_path = x64
+ processor_path = x86_64
}
PROCESSOR_x86 {