2019-07-28 23:37:40 +03:00
|
|
|
#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>
|
2019-07-28 23:37:40 +03:00
|
|
|
|
|
|
|
ClientApp::ClientApp() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-07-29 11:45:04 +03:00
|
|
|
bool ClientApp::init(QQmlApplicationEngine *engine) {
|
2019-07-28 23:37:40 +03:00
|
|
|
|
|
|
|
qmlRegisterType <GuiObject> ();
|
|
|
|
qmlRegisterType <Diff> ();
|
2019-07-29 11:45:04 +03:00
|
|
|
qmlRegisterType <MainMenuModel> ();
|
2019-07-28 23:37:40 +03:00
|
|
|
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;
|
|
|
|
}
|