camper/src/main.cpp

24 lines
633 B
C++
Raw Normal View History

2024-12-14 00:19:20 +00:00
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "database.h"
2024-12-14 00:19:20 +00:00
int main(int argc, char *argv[])
{
QCoreApplication::setApplicationName("Camper");
QCoreApplication::setOrganizationName("Tandem");
QGuiApplication app(argc, argv);
Database::getInstance(); // return ignored; create instance before QML engine
2024-12-14 00:19:20 +00:00
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("Camper", "Main");
return app.exec();
}