-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
24 lines (22 loc) · 803 Bytes
/
Copy pathmain.cpp
File metadata and controls
24 lines (22 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <QtGui/QGuiApplication>
#include <QtQml>
#include "qtquick2applicationviewer.h"
#include "pagestack.h"
#include "gamecontroller.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QtQuick2ApplicationViewer viewer;
PageStack* ps = new PageStack;
ps->addPageToSave(QString("GameField"));
ps->addPageToSave(QString("MainMenu"));
ps->setCurrentPage(QString("GameField"));
qmlRegisterType<GameController>("Custom", 1, 0, "GameController");
qmlRegisterType<Player>("Custom", 1, 0, "PlayerCpp");
QQmlContext *root = viewer.rootContext();
root->setContextProperty("pageStackBackend", ps);
viewer.setMainQmlFile(QStringLiteral("qml/MafiaHelper/main.qml"));
viewer.showExpanded();
//viewer.showExpanded();
return app.exec();
}