-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (24 loc) · 848 Bytes
/
main.cpp
File metadata and controls
32 lines (24 loc) · 848 Bytes
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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QIcon>
#include <QDebug>
#include "backend.h"
#include "filereader.h"
int main(int argc, char *argv[]) {
qputenv("QML_XHR_ALLOW_FILE_READ", "1");
QGuiApplication app(argc, argv);
app.setWindowIcon(QIcon("qrc:/icons/app-icon.png"));
// Register C++ types
qmlRegisterType<Backend>("com.company.backend", 1, 0, "Backend");
qmlRegisterType<FileReader>("com.company.filereader", 1, 0, "FileReader");
QQmlApplicationEngine engine;
// Debug output
qDebug() << "QML import paths:" << engine.importPathList();
// Load from QML module
engine.loadFromModule("plagiarism.detector", "Main");
if (engine.rootObjects().isEmpty()) {
qCritical() << "Failed to load QML interface";
return -1;
}
return app.exec();
}