-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.cpp
52 lines (35 loc) · 1.56 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
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include <QmlVlc.h>
#include <QmlVlc/QmlVlcConfig.h>
#include <QtWebEngine/qtwebengineglobal.h>
#include <MetadataProvider/MetadataProvider.h>
int main(int argc, char *argv[])
{
RegisterQmlVlc();
QmlVlcConfig& config = QmlVlcConfig::instance();
config.enableDebug( false );
qmlRegisterType<MetadataProvider>("vmf3.demo.metadata", 1, 0, "MetadataProvider");
qmlRegisterType<Location>("vmf3.demo.metadata", 1, 0, "Location");
qmlRegisterType<WrappingInfo>("vmf3.demo.metadata", 1, 0, "WrappingInfo");
qmlRegisterType<StatInfo>("vmf3.demo.metadata", 1, 0, "StatInfo");
//qmlRegisterType<QQmlListProperty<Location>>("vmf3.demo.metadata", 1, 0, "LocationList");
//qRegisterMetaType<QQmlListProperty<Location>>();
QApplication app(argc, argv);
QtWebEngine::initialize();
QQmlApplicationEngine engine;
//this code has no visible effect
// engine.addImportPath(QStringLiteral(":/imports"));
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
//everything works fine w/o that code
// QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit()));
//this code was used to call init function from QML file
//obviously it should be changed
//"parameters" were taken from comand line, can be empty
// QObject *item = engine.rootObjects().first();
// Q_ASSERT(item);
// QMetaObject::invokeMethod(item, "initializeProviders",
// Q_ARG(QVariant, QVariant::fromValue(parameters)));
return app.exec();
}