2018-08-12 20:51:57 +02:00
|
|
|
/*
|
|
|
|
Speed Climbing Stopwatch - Simple Stopwatch for Climbers
|
|
|
|
Copyright (C) 2018 Itsblue Development - Dorian Zeder
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, version 3 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-07-17 19:17:25 +02:00
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
2021-03-19 18:02:10 +01:00
|
|
|
#include <QQmlEngine>
|
2018-07-22 16:47:55 +02:00
|
|
|
#include <QSqlDatabase>
|
|
|
|
#include <QSqlError>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QStandardPaths>
|
2018-10-04 18:35:29 +02:00
|
|
|
//#include <QtWebView/QtWebView>
|
2018-07-25 00:32:20 +02:00
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQuickView>
|
|
|
|
#include <QStandardPaths>
|
|
|
|
#include <QtQml>
|
|
|
|
#include <QtNetwork>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QDesktopServices>
|
2020-10-01 02:27:00 +02:00
|
|
|
#include <QScreen>
|
|
|
|
#include <QRect>
|
2018-07-25 00:32:20 +02:00
|
|
|
|
|
|
|
#include <QtCore/QUrl>
|
|
|
|
#include <QtCore/QCommandLineOption>
|
|
|
|
#include <QtCore/QCommandLineParser>
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QStyleHints>
|
|
|
|
#include <QScreen>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QtQml/QQmlContext>
|
2020-04-06 17:52:48 +02:00
|
|
|
|
2020-07-06 15:04:02 +02:00
|
|
|
#include "headers/scstwappsettings.h"
|
2020-04-15 21:47:55 +02:00
|
|
|
//#include "headers/speedtimer.h"
|
|
|
|
//#include "headers/climbingrace.h"
|
|
|
|
#include "headers/scstwappbackend.h"
|
2020-05-26 17:57:54 +02:00
|
|
|
#include <scstwlibraries.h>
|
2018-08-14 17:07:42 +02:00
|
|
|
#include <QTranslator>
|
2018-07-22 16:47:55 +02:00
|
|
|
|
2018-07-17 19:17:25 +02:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2020-10-01 14:19:47 +02:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
2018-07-17 19:17:25 +02:00
|
|
|
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
2020-05-26 17:57:54 +02:00
|
|
|
// setup speed backend
|
|
|
|
qmlRegisterType<ScStwAppBackend>("de.itsblue.ScStwApp", 2, 0, "SpeedBackend");
|
2020-10-09 15:44:24 +02:00
|
|
|
qmlRegisterType<ScStwAppSettings>("de.itsblue.ScStwApp", 2, 0, "ScStwAppSettings");
|
2020-07-10 15:20:41 +02:00
|
|
|
|
|
|
|
qRegisterMetaType<ScStwAppSettings::AppInternalSetting>("ScStwAppSettings::BaseStationSetting");
|
2018-09-17 23:06:34 +02:00
|
|
|
|
2018-07-17 19:17:25 +02:00
|
|
|
QQmlApplicationEngine engine;
|
2020-10-01 14:19:47 +02:00
|
|
|
|
2021-01-15 20:19:49 +01:00
|
|
|
// pass app version to qml
|
|
|
|
engine.rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
|
|
|
|
|
2020-05-26 17:57:54 +02:00
|
|
|
ScStwLibraries::init();
|
2020-07-03 15:37:44 +02:00
|
|
|
ScStwLibraries::initStyling(&engine);
|
2020-05-26 17:57:54 +02:00
|
|
|
|
2020-10-01 14:19:47 +02:00
|
|
|
const QUrl url(QStringLiteral("qrc:/main.qml"));
|
|
|
|
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
2021-03-19 18:02:10 +01:00
|
|
|
&app, [url](QObject *obj, const QUrl &objUrl) {
|
2020-10-01 14:19:47 +02:00
|
|
|
if (!obj && url == objUrl)
|
|
|
|
QCoreApplication::exit(-1);
|
|
|
|
}, Qt::QueuedConnection);
|
|
|
|
engine.load(url);
|
2018-07-17 19:17:25 +02:00
|
|
|
|
2020-10-01 01:54:38 +02:00
|
|
|
return app.exec();
|
2018-07-17 19:17:25 +02:00
|
|
|
}
|