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++

3 years ago
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#include <QIcon>
8 months ago
#include <QQmlContext>
3 years ago
#include "droidstar.h"
int main(int argc, char *argv[])
{
8 months ago
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("Fusion");
app.setWindowIcon(QIcon(":/images/droidstar.png"));
qmlRegisterType<DroidStar>("org.dudetronics.droidstar", 1, 0, "DroidStar");
3 years ago
8 months ago
QQmlApplicationEngine engine;
#ifdef USE_FLITE
8 months ago
engine.rootContext()->setContextProperty("USE_FLITE", QVariant(true));
#else
8 months ago
engine.rootContext()->setContextProperty("USE_FLITE", QVariant(false));
#endif
8 months ago
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();
3 years ago
}