mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-29 03:04:42 +00:00
31 lines
675 B
C++
31 lines
675 B
C++
#include "clientapp.h"
|
|
#include "ProfileViewItems/userview.h"
|
|
#include <QQmlApplicationEngine>
|
|
#include <QQmlContext>
|
|
|
|
#include <back-end/ProfileViewItems/mainmenumodel.h>
|
|
|
|
ClientApp::ClientApp() {
|
|
|
|
}
|
|
|
|
bool ClientApp::init(QQmlApplicationEngine *engine) {
|
|
|
|
qmlRegisterType <GuiObject> ();
|
|
qmlRegisterType <Diff> ();
|
|
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;
|
|
}
|