-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
56 lines (40 loc) · 2.18 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
51
52
53
54
55
56
#include <QApplication>
#include <FelgoApplication>
#include <QQmlApplicationEngine>
#define STRINGIZE(x) #x
#define QUOTE(x) STRINGIZE(x)
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
FelgoApplication felgo;
// QQmlApplicationEngine is the preferred way to start qml projects since Qt 5.2
// if you have older projects using Qt App wizards from previous QtCreator versions than 3.1, please change them to QQmlApplicationEngine
QQmlApplicationEngine engine;
felgo.initialize(&engine);
QString arcGISRuntimeImportPath = QUOTE(ARCGIS_RUNTIME_IMPORT_PATH);
QString arcGISToolkitImportPath = QUOTE(ARCGIS_TOOLKIT_IMPORT_PATH);
#if defined(LINUX_PLATFORM_REPLACEMENT)
// on some linux platforms the string 'linux' is replaced with 1
// fix the replacement paths which were created
QString replaceString = QUOTE(LINUX_PLATFORM_REPLACEMENT);
arcGISRuntimeImportPath = arcGISRuntimeImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
arcGISToolkitImportPath = arcGISToolkitImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
#endif
// Add the Runtime and Extras path
engine.addImportPath(arcGISRuntimeImportPath);
// Add the Toolkit path
engine.addImportPath(arcGISToolkitImportPath);
// Set an optional license key from project file
// This does not work if using Felgo Live, only for Felgo Cloud Builds and local builds
felgo.setLicenseKey(PRODUCT_LICENSE_KEY);
// use this during development
// for PUBLISHING, use the entry point below
felgo.setMainQmlFileName(QStringLiteral("qml/Main.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
// felgo.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
engine.load(QUrl(felgo.mainQmlFileName()));
return app.exec();
}