forked from nspire-emus/firebird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
42 lines (34 loc) · 1.09 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
#include <QApplication>
#include <QTranslator>
#include <QtQml>
#ifndef MOBILE_UI
#include "mainwindow.h"
#else
#include <QQuickView>
#endif
#include "qtframebuffer.h"
#include "qmlbridge.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QTranslator appTranslator;
appTranslator.load(QLocale::system().name(), ":/i18n/i18n/");
app.installTranslator(&appTranslator);
QCoreApplication::setOrganizationName("ndless");
QCoreApplication::setApplicationName("nspire_emu");
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
// Register QMLBridge for Keypad<->Emu communication
qmlRegisterSingletonType<QMLBridge>("Ndless.Emu", 1, 0, "Emu", qmlBridgeFactory);
// Register QtFramebuffer for QML display
qmlRegisterType<QMLFramebuffer>("Ndless.Emu", 1, 0, "Screen");
#ifndef MOBILE_UI
MainWindow mw;
main_window = &mw;
mw.show();
#else
QQuickView mobile_ui(QUrl("qrc:/qml/qml/MobileUI.qml"));
mobile_ui.setResizeMode(QQuickView::SizeRootObjectToView);
mobile_ui.show();
#endif
return app.exec();
}