41 lines
1.1 KiB
C++
Raw Normal View History

2019-01-04 10:47:18 +01:00
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#include <QIcon>
#include <QDir>
#include <QFile>
#include <QStandardPaths>
#include "QtAndroidTools.h"
2019-01-04 10:47:18 +01:00
2020-08-21 09:04:21 +02:00
void prepareSharedFiles(const QString &sharedFolderName)
2020-02-17 14:02:33 +01:00
{
2020-08-21 09:04:21 +02:00
const QDir sharedFilesFolder(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
2020-02-17 14:02:33 +01:00
2020-08-21 09:04:21 +02:00
if(sharedFilesFolder.mkdir(sharedFolderName) == true)
2020-02-17 14:02:33 +01:00
{
2020-08-21 09:04:21 +02:00
const QString sharedFilesPath = (sharedFilesFolder.path() + "/" + sharedFolderName);
2020-02-17 14:02:33 +01:00
2020-08-21 09:04:21 +02:00
QFile::copy(":/images/logo_falsinsoft.jpg", sharedFilesPath + "/logo_falsinsoft.jpg");
2020-02-17 14:02:33 +01:00
}
}
2019-01-04 10:47:18 +01:00
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QQuickStyle::setStyle("Material");
QIcon::setThemeName("tools");
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
2020-04-24 13:24:54 +02:00
2020-08-21 09:04:21 +02:00
QtAndroidTools::initializeQmlTools();
2020-04-24 13:24:54 +02:00
QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit()));
2019-01-04 10:47:18 +01:00
engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
if(engine.rootObjects().isEmpty()) return -1;
2020-08-21 09:04:21 +02:00
prepareSharedFiles("sharedfiles");
2019-01-04 10:47:18 +01:00
2020-04-24 13:24:54 +02:00
QtAndroid::hideSplashScreen();
2019-01-04 10:47:18 +01:00
return app.exec();
}