forked from FelgoSDK/Qt-World-Summit-Conference-App
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (28 loc) · 1.36 KB
/
main.cpp
File metadata and controls
39 lines (28 loc) · 1.36 KB
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
#include <QApplication>
#include <VPApplication>
#include <QQmlApplicationEngine>
#include "cpp/diskcachefactory.h"
#include <QZXing.h> // QZXing framework for barcode scanning
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
VPApplication vplay;
// Use platform-specific fonts instead of V-Play's default font
vplay.setPreservePlatformFonts(true);
QQmlApplicationEngine engine;
vplay.initialize(&engine);
// use this during development
// for PUBLISHING, use the entry point below
vplay.setMainQmlFileName(QStringLiteral("qml/QtWSMain.qml"));
// use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc
// this is the preferred deployment option for publishing games to the app stores, because then your qml files and js files are protected
// to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file
// also see the .pro file for more details
// vplay.setMainQmlFileName(QStringLiteral("qrc:/qml/QtWSMain.qml"));
// 10MB cache for network data (chris bartsch style)
engine.setNetworkAccessManagerFactory(new DiskCacheFactory(1024 * 1024 * 10));
// register QZXing qml types for barcode scannning
QZXing::registerQMLTypes();
engine.load(QUrl(vplay.mainQmlFileName()));
return app.exec();
}