Rely on Qt utilities for configuring QQC2 style

This commit is contained in:
Martchus 2018-06-16 13:23:13 +02:00
parent 974910dbf6
commit a358346150
2 changed files with 9 additions and 5 deletions

View File

@ -9,7 +9,8 @@ set(META_APP_CATEGORIES "Utility;Security;")
set(META_APP_AUTHOR "Martchus")
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
set(META_APP_DESCRIPTION "A simple password store using AES-256-CBC encryption via OpenSSL")
set(META_GUI_OPTIONAL true)
set(META_GUI_OPTIONAL YES)
set(META_USE_QQC2 ON)
set(META_VERSION_MAJOR 2)
set(META_VERSION_MINOR 1)
set(META_VERSION_PATCH 5)
@ -125,7 +126,10 @@ use_cpp_utilities()
include(BasicConfig)
# find qtutilities
if(WIDGETS_GUI OR QUICK_GUI)
if(QUICK_GUI)
find_package(qtutilities 5.11.0 REQUIRED)
use_qt_utilities()
elseif(WIDGETS_GUI)
find_package(qtutilities 5.7.0 REQUIRED)
use_qt_utilities()
endif()
@ -139,6 +143,7 @@ if(WIDGETS_GUI OR QUICK_GUI)
include(QtGuiConfig)
include(QtConfig)
endif()
include(WindowsResources)
include(AppTarget)
include(ShellCompletion)

View File

@ -3,6 +3,7 @@
#include "resources/config.h"
#define QT_UTILITIES_GUI_QTQUICK
#include <qtutilities/resources/qtconfigarguments.h>
#include <qtutilities/resources/resources.h>
@ -23,9 +24,6 @@ namespace QtGui {
int runQuickGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs, const QString &file)
{
// init application
#ifdef __ANDROID__
qputenv("QT_QUICK_CONTROLS_STYLE", "material");
#endif
SET_QT_APPLICATION_INFO;
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#ifdef PASSWORD_MANAGER_GUI_QTWIDGETS
@ -36,6 +34,7 @@ int runQuickGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs, c
// apply settings specified via command line args
qtConfigArgs.applySettings();
qtConfigArgs.applySettingsForQuickGui();
// load translations and enforce UTF-8 locale
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));