some refactoring issues in the qml gui

This commit is contained in:
Felix Hammer
2015-01-15 18:03:09 +01:00
parent e617c667e1
commit 67c444266f
4 changed files with 18 additions and 7 deletions
+5 -1
View File
@@ -1,9 +1,12 @@
#include <QtCore>
#include "startview/startview.h"
#include "qmlwrapper.h"
qmlWrapper::qmlWrapper()
{
qDebug("qmlWrapperKonstruktor");
myStartView.reset(new startView);
}
qmlWrapper::~qmlWrapper()
@@ -16,5 +19,6 @@ qmlWrapper::qmlWrapper(const qmlWrapper&)
void qmlWrapper::showStartView()
{
myStartView.show();
qDebug("showStartView() in qmlWrapper");
myStartView->show();
}
+4 -2
View File
@@ -1,7 +1,9 @@
#ifndef QMLWRAPPER_H
#define QMLWRAPPER_H
#include "startview/startview.h"
#include <boost/shared_ptr.hpp>
class startView;
class qmlWrapper
{
@@ -13,7 +15,7 @@ public:
void showStartView();
private:
startView myStartView;
boost::shared_ptr<startView> myStartView;
};
#endif // QMLWRAPPER_H
+5 -2
View File
@@ -1,8 +1,11 @@
#include <QQmlApplicationEngine>
#include "startview.h"
startView::startView()
{
qDebug("startViewKonstruktor");
myEngine.reset(new QQmlApplicationEngine);
}
startView::~startView()
@@ -17,6 +20,6 @@ startView::startView(const startView&)
void startView::show()
{
qDebug("show mal bitte");
myEngine.load(QUrl(QStringLiteral("qrc:/main.qml")));
qDebug("show() in startView");
myEngine->load(QUrl(QStringLiteral("qrc:/main.qml")));
}
+4 -2
View File
@@ -1,7 +1,9 @@
#ifndef STARTVIEW_H
#define STARTVIEW_H
#include <QQmlApplicationEngine>
#include <boost/shared_ptr.hpp>
class QQmlApplicationEngine;
class startView
{
@@ -13,7 +15,7 @@ public:
void show();
private:
QQmlApplicationEngine myEngine;
boost::shared_ptr<QQmlApplicationEngine> myEngine;
};
#endif // STARTVIEW_H