39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
#include <QApplication>
|
|
#include <QQmlApplicationEngine>
|
|
#include <QtQml>
|
|
#include <QUrl>
|
|
#include "miflora/miflora.h"
|
|
#include "miflora/bluetoothdevices.h"
|
|
#include <KAboutData>
|
|
#include <QIcon>
|
|
|
|
Q_DECL_EXPORT int main(int argc, char *argv[])
|
|
{
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
QApplication app(argc, argv);
|
|
|
|
KAboutData aboutData("org.eyecreate.qiflora", "QiFlora", "1.1.2", "Mobile friendly application to monitor Mi Flora devices.",KAboutLicense::GPL_V3);//TODO:i18n
|
|
aboutData.setProductName("qiflora");
|
|
aboutData.addAuthor("Kevin Whitaker",QString(),"eyecreate@eyecreate.org","https://www.eyecreate.org");
|
|
aboutData.setDesktopFileName("org.eyecreate.qiflora");
|
|
|
|
QCoreApplication::setOrganizationName("eyecreate");
|
|
QCoreApplication::setOrganizationDomain("eyecreate.org");
|
|
QCoreApplication::setApplicationName(aboutData.productName());
|
|
QCoreApplication::setApplicationVersion(aboutData.version());
|
|
app.setWindowIcon(QIcon::fromTheme("org.eyecreate.qiflora"));
|
|
|
|
|
|
QQmlApplicationEngine engine;
|
|
qmlRegisterType<BluetoothDevices>();
|
|
qmlRegisterType<MiFlora>("org.eyecreate.qiflora",1,1,"QiFlora");
|
|
engine.rootContext()->setContextProperty(QStringLiteral("appAboutData"), QVariant::fromValue(aboutData));
|
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
|
|
|
if (engine.rootObjects().isEmpty()) {
|
|
return -1;
|
|
}
|
|
|
|
return app.exec();
|
|
}
|