From 59be048549cfe620d0ddfcd891e04ec6e2fad3f7 Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Thu, 4 Jun 2015 13:29:50 +0300 Subject: Add QMLManager class Add a QMLManager class. This class will be used as a link between the C++ and QML aspects of the mobile application. Signed-off-by: Grace Karanja Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 31 +++++++++++++++++++++++++++++++ qt-mobile/qmlmanager.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 qt-mobile/qmlmanager.cpp create mode 100644 qt-mobile/qmlmanager.h (limited to 'qt-mobile') diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp new file mode 100644 index 000000000..2de94e82d --- /dev/null +++ b/qt-mobile/qmlmanager.cpp @@ -0,0 +1,31 @@ +#include "qmlmanager.h" + + +QMLManager::QMLManager() +{ + +} + + +QMLManager::~QMLManager() +{ + +} + +QString QMLManager::filename() +{ + return m_fileName; +} + +void QMLManager::setFilename(const QString &f) +{ + m_fileName = f; + emit filenameChanged(); + loadFile(); +} + +void QMLManager::loadFile() +{ + QUrl url(m_fileName); + QString strippedFileName = url.toLocalFile(); +} diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h new file mode 100644 index 000000000..e74db0b9a --- /dev/null +++ b/qt-mobile/qmlmanager.h @@ -0,0 +1,31 @@ +#ifndef QMLMANAGER_H +#define QMLMANAGER_H + +#include +#include + +class QMLManager : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged) +public: + QMLManager(); + ~QMLManager(); + + QString filename(); + + void getFile(); + + +public slots: + void setFilename(const QString &f); + +private: + QString m_fileName; + void loadFile(); + +signals: + void filenameChanged(); +}; + +#endif -- cgit v1.2.3-70-g09d2