-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (23 loc) · 752 Bytes
/
main.cpp
File metadata and controls
28 lines (23 loc) · 752 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
25
26
27
28
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlEngine>
#include "GameView/mainwindow.h"
void registerQmlTypes()
{
qmlRegisterType<View::GameView>("GoL", 1, 0, "GameView");
qmlRegisterType<View::MainWindow>("GoL", 1, 0, "MainWindow");
qmlRegisterType<View::GameParams>("GoL", 1, 0, "GameParams");
}
int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
registerQmlTypes();
QQuickView view(QUrl(QStringLiteral("qrc:/MainWindow.qml")));
QObject::connect(view.engine(), &QQmlEngine::quit, &app, &QGuiApplication::quit);
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.show();
return app.exec();
}