-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
29 lines (24 loc) · 891 Bytes
/
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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QStandardPaths>
#include <QString>
#include "browser.h"
#include "settings.h"
#include "cppmodel.h"
int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<Browser>("cppbrowser", 1, 0, "FileBrowser");
qmlRegisterType<Settings>("cppsettings", 1, 0, "Setter");
qmlRegisterType<CppModel>("cppmodel", 1, 0, "Cppmodel");
engine.rootContext()->setContextProperty("dPath", QStandardPaths::standardLocations(QStandardPaths::MusicLocation).at(0)/*"file:///storage/emulated/0/Music"*/);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}