- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
Latest commit
62 lines (49 loc) · 1.94 KB
/
Copy pathmain.cpp
File metadata and controls
62 lines (49 loc) · 1.94 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include<QGuiApplication>
#include<QApplication>
#include<QQmlApplicationEngine>
#include<QQuickView>
#include<QMediaPlayer>
#include"WorkerThread.h"// Include the WorkerThread header
#include<QLoggingCategory>
#include<QQmlContext>
#include<QDebug>
#include<QtGlobal>
#include<mlt++/Mlt.h>
#include<iostream>
#include<string>
#include<ostream>
#include<QCoreApplication>
intmain(int argc, char *argv[])
{
QApplication app(argc, argv);
SetDllDirectory(L".");
QString dllPath = QApplication::applicationDirPath();
qDebug() << "@@@: " + dllPath;
QApplication::addLibraryPath(dllPath);
WorkerThread worker;
qDebug() << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
qDebug() << "MLT_REPOSITORY:" << qgetenv("MLT_REPOSITORY");
qDebug() << "MLT_DATA:" << qgetenv("MLT_DATA");
qDebug() << "DYLD_LIBRARY_PATH:" << qgetenv("DYLD_LIBRARY_PATH");
qDebug() << "PATH:" << qgetenv("PATH");
std::cout << qgetenv("MLT_REPOSITORY").toStdString() << std::endl;
std::cout << qgetenv("MLT_DATA").toStdString() << std::endl;
std::cout << qgetenv("DYLD_LIBRARY_PATH").toStdString() << std::endl;
std::cout << qgetenv("PATH").toStdString() << std::endl;
QString execDirPath = QCoreApplication::applicationDirPath();
qDebug() << "Executable directory path:" << execDirPath;
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("worker", &worker);
// important
// engine.addImportPath("C:/Qt/Qt5.14.2/5.14.2/mingw73_64/qml");
// engine.addImportPath("C:/msys64/mingw64/share/qt5/qml");
const QUrl url(QStringLiteral("qrc:/main.qml"));
engine.load(url);
if (engine.rootObjects().isEmpty())
return -1;
QLoggingCategory::setFilterRules("qt.multimedia.debug=true");
// worker.start();
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}