Un inicio
This commit is contained in:
35
src/main.cpp
Normal file
35
src/main.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "logger.hpp"
|
||||
#include "playlist-controller.hpp"
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QUrl>
|
||||
#include <filesystem>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
qInstallMessageHandler(MessageHandler);
|
||||
std::filesystem::path cwd = std::filesystem::current_path();
|
||||
Logger::info(cwd.string());
|
||||
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
PlaylistController playlist;
|
||||
engine.rootContext()->setContextProperty("playlist", &playlist);
|
||||
|
||||
const QUrl url(QStringLiteral("qrc:/App/ui/main.qml"));
|
||||
|
||||
QObject::connect(
|
||||
&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
|
||||
[]() { QCoreApplication::exit(-1); }, Qt::QueuedConnection);
|
||||
|
||||
engine.load(url);
|
||||
|
||||
Logger::info("Engine loaded");
|
||||
|
||||
playlist.addToQueue("../ui/media/video.mp4");
|
||||
playlist.addToQueue("../ui/media/Puta.mp4");
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user