Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
47 lines (41 loc) · 1.36 KB

File metadata and controls

47 lines (41 loc) · 1.36 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#include <QCommandLineParser>
#include <QFile>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
app.setOrganizationName("machinekoder.com");
app.setOrganizationDomain("machinekoder.com");
app.setApplicationName("LiveCodingExample");
app.setApplicationDisplayName("Live Coding Example");
QCommandLineParser parser;
parser.setApplicationDescription("Live Coding Example");
parser.addHelpOption();
#ifdef QT_DEBUG
QCommandLineOption forceOption(QStringList() << "l" << "live",
QCoreApplication::translate("live", "Start live coding mode."));
parser.addOption(forceOption);
#endif
parser.process(app);
QString fileName = QStringLiteral("main.qml");
#ifdef QT_DEBUG
if (parser.isSet(forceOption)) {
fileName = QStringLiteral("live.qml");
}
#endif
QQmlApplicationEngine engine;
engine.addImportPath(QStringLiteral("."));
engine.addImportPath(QStringLiteral("qrc:/"));
QFile file(QStringLiteral("./") + fileName);
if (file.exists()) {
engine.load(QStringLiteral("./") + fileName);
}
else {
engine.load(QUrl(QStringLiteral("qrc:/") + fileName));
}
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.