32 lines
715 B
C++
32 lines
715 B
C++
|
|
#include <iostream>
|
|
|
|
#include <QGuiApplication>
|
|
#include <QQmlApplicationEngine>
|
|
#include <QQmlContext>
|
|
|
|
#include "TimerComponent.hpp"
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
// create application
|
|
QGuiApplication app(argc, argv);
|
|
QQmlApplicationEngine engine;
|
|
|
|
// attach backend gui components
|
|
qmlRegisterType<TimerComponent>("AppDemo", 1, 0, "TimerComponent");
|
|
|
|
// load qml
|
|
//engine.loadFromModule("sonobulus", "Main");
|
|
//engine.load(QUrl("qrc:/Main.qml"));
|
|
engine.load(QUrl::fromLocalFile("src/Main.qml")); // ugh
|
|
|
|
if(engine.rootObjects().isEmpty()) {
|
|
std::cout << "engine is empty" << std::endl;
|
|
return -1;
|
|
}
|
|
|
|
// execute app
|
|
return app.exec();
|
|
}
|