diff --git a/src/gui/qml/qmlwrapper.cpp b/src/gui/qml/qmlwrapper.cpp index 92b27231..db5592b5 100644 --- a/src/gui/qml/qmlwrapper.cpp +++ b/src/gui/qml/qmlwrapper.cpp @@ -1,9 +1,12 @@ #include +#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(); } diff --git a/src/gui/qml/qmlwrapper.h b/src/gui/qml/qmlwrapper.h index 580a2a1a..b01d15ad 100644 --- a/src/gui/qml/qmlwrapper.h +++ b/src/gui/qml/qmlwrapper.h @@ -1,7 +1,9 @@ #ifndef QMLWRAPPER_H #define QMLWRAPPER_H -#include "startview/startview.h" +#include + +class startView; class qmlWrapper { @@ -13,7 +15,7 @@ public: void showStartView(); private: - startView myStartView; + boost::shared_ptr myStartView; }; #endif // QMLWRAPPER_H diff --git a/src/gui/qml/views/startview/startview.cpp b/src/gui/qml/views/startview/startview.cpp index 2008a6e2..69379039 100644 --- a/src/gui/qml/views/startview/startview.cpp +++ b/src/gui/qml/views/startview/startview.cpp @@ -1,8 +1,11 @@ +#include + #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"))); } diff --git a/src/gui/qml/views/startview/startview.h b/src/gui/qml/views/startview/startview.h index 57c13393..6d10bb53 100644 --- a/src/gui/qml/views/startview/startview.h +++ b/src/gui/qml/views/startview/startview.h @@ -1,7 +1,9 @@ #ifndef STARTVIEW_H #define STARTVIEW_H -#include +#include + +class QQmlApplicationEngine; class startView { @@ -13,7 +15,7 @@ public: void show(); private: - QQmlApplicationEngine myEngine; + boost::shared_ptr myEngine; }; #endif // STARTVIEW_H