-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
50 lines (42 loc) · 1.24 KB
/
main.cpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>
//#undef main
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
//#include <QDebug>
#include <QList>
#include <QStringList>
#include <QDir>
#include <QStandardPaths>
#include <QSettings>
int main(int argc, char *argv[])
{
//QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
QGuiApplication app(argc, argv);
app.setOrganizationName("AutismPowered");
app.setApplicationName("SDL2GameControllerMapper");
QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
QDir dir;
if (!dir.exists(appDataPath))
{
dir.mkpath(appDataPath);
}
QString appStyle = QQuickStyle::name();
//qDebug() << "APP STYLE: " << appStyle;
if (appStyle.isEmpty())
{
QQuickStyle::setStyle("Fusion");
}
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.addImportPath(":/");
engine.load(url);
return app.exec();
}