diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b9a5ec..97ca194 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,7 @@ set(keysmith_internal_libs keysmith_lib) qt5_add_resources(RESOURCES resources.qrc) add_executable(keysmith ${keysmith_SRCS} ${RESOURCES}) target_link_libraries(keysmith - Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick Qt5::Svg + Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick Qt5::Svg Qt5::QuickControls2 KF5::I18n ${keysmith_internal_libs} ) diff --git a/src/main.cpp b/src/main.cpp index 7c03b0b..a992520 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,12 +4,18 @@ * SPDX-FileCopyrightText: 2020-2021 Johan Ouwerkerk */ -#include #include #include +#include #include #include +#ifdef Q_OS_ANDROID +#include +#else +#include +#endif + #include #include @@ -42,7 +48,17 @@ static QQmlDebuggingEnabler enabler; Q_DECL_EXPORT int main(int argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + +#ifdef Q_OS_ANDROID + QGuiApplication app(argc, argv); + QQuickStyle::setStyle(QStringLiteral("Material")); +#else QApplication app(argc, argv); + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); + } +#endif + KLocalizedString::setApplicationDomain("keysmith"); QCoreApplication::setOrganizationName(QStringLiteral("KDE"));