Files
pokerth/src/gui/qml/cpp/qmlwrapper.cpp
T

30 lines
585 B
C++
Raw Normal View History

2015-08-13 15:35:25 +02:00
#include <QtCore>
#include <QQmlApplicationEngine>
#include <configfile.h>
#include <boost/shared_ptr.hpp>
#include "qmlwrapper.h"
QmlWrapper::QmlWrapper(boost::shared_ptr<ConfigFile> c)
:QObject(), myConfig(c)
{
qDebug("QmlWrapperKonstruktor");
myEngine.reset(new QQmlApplicationEngine);
// Add c++ content here
// myEngine.rootContext()->setContextProperty("model1", &model1);
myEngine->load(QUrl(QStringLiteral("qrc:/main.qml")));
}
QmlWrapper::~QmlWrapper()
{
myEngine->deleteLater();
}
QmlWrapper::QmlWrapper(const QmlWrapper&)
:QObject()
{
}