You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
949 B
C++

#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#include <QIcon>
#include <QQmlContext>
#include "droidstar.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("Fusion");
app.setWindowIcon(QIcon(":/images/droidstar.png"));
qmlRegisterType<DroidStar>("org.dudetronics.droidstar", 1, 0, "DroidStar");
QQmlApplicationEngine engine;
#ifdef USE_FLITE
engine.rootContext()->setContextProperty("USE_FLITE", QVariant(true));
#else
engine.rootContext()->setContextProperty("USE_FLITE", QVariant(false));
#endif
const QUrl url(u"qrc:/DroidStar/main.qml"_qs);
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
return app.exec();
}