blob: 0cec6f3a3f1c70f6f291a73cd7c4b525450672c2 (
plain)
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
|
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QDebug>
//extern type registration
extern void qml_register_types_My_Module6();
int main(int argCount, char* argVector[])
{
//register resources from static libraries
Q_INIT_RESOURCE(My_Module6);
Q_INIT_RESOURCE(qmlcache_My_Module6);
qml_register_types_My_Module6();
//don't require a grapical environment to run the test
qputenv("QT_QPA_PLATFORM", "offscreen");
QGuiApplication app(argCount, argVector);
QQmlApplicationEngine engine;
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, [](QObject *object, const QUrl &url){
if (object == nullptr) {
qFatal("unable to load scene");
}
});
engine.addImportPath("qrc:///qt/qml");
engine.addImportPath("qrc:///test");
engine.load("qrc:///qt/qml/My/Module0/Main.qml");
return app.exec();
}
|