31 lines
675 B
C++
Raw Normal View History

#include "clientapp.h"
#include "ProfileViewItems/userview.h"
#include <QQmlApplicationEngine>
#include <QQmlContext>
2019-07-29 11:45:04 +03:00
#include <back-end/ProfileViewItems/mainmenumodel.h>
ClientApp::ClientApp() {
}
2019-07-29 11:45:04 +03:00
bool ClientApp::init(QQmlApplicationEngine *engine) {
qmlRegisterType <GuiObject> ();
qmlRegisterType <Diff> ();
2019-07-29 11:45:04 +03:00
qmlRegisterType <MainMenuModel> ();
qmlRegisterType <UserView> ();
auto root = engine->rootContext();
if (!root)
return false;
root->setContextProperty("contr", &contr);
engine->load(QUrl(QStringLiteral("qrc:/front-end/main.qml")));
if (engine->rootObjects().isEmpty())
return false;
return true;
}