Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KAlgebra
Commits
be0eef9d
Commit
be0eef9d
authored
Dec 12, 2020
by
Carl Schwan
🚴
Browse files
Use QtQuick Controls 2 desktop style on the desktop
Also move some ifdef to a more modern style.
parent
9ed37d77
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
be0eef9d
...
...
@@ -11,7 +11,7 @@ project(kalgebra VERSION ${RELEASE_SERVICE_VERSION})
find_package
(
ECM 1.7.0 REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
${
ECM_MODULE_PATH
}
)
find_package
(
Qt5 5.
2
REQUIRED NO_MODULE COMPONENTS Qml Quick Xml Svg PrintSupport Test
)
find_package
(
Qt5 5.
14
REQUIRED NO_MODULE COMPONENTS Qml Quick Xml Svg PrintSupport Test
)
include
(
KDEInstallDirs
)
include
(
KDECompilerSettings NO_POLICY_SCOPE
)
include
(
KDECMakeSettings
)
...
...
mobile/CMakeLists.txt
View file @
be0eef9d
...
...
@@ -12,13 +12,17 @@ target_link_libraries(kalgebramobile Qt5::Qml Qt5::Quick Qt5::Gui
set
(
DESKTOPFILE_INSTALL
${
KDE_INSTALL_APPDIR
}
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Android"
)
if
(
ANDROID
)
# Material requires QtSvg for icons
# if we don't link it here explicitly, androiddeployqt doesn't bring it
find_package
(
Qt5Svg REQUIRED
)
find_package
(
Qt5QuickControls2 REQUIRED
)
find_package
(
KF5Kirigami2 REQUIRED
)
kirigami_package_breeze_icons
(
ICONS list-add
)
target_link_libraries
(
kalgebramobile Qt5::Svg KF5::Kirigami2
)
target_link_libraries
(
kalgebramobile Qt5::Svg KF5::Kirigami2 Qt5::QuickControls2
)
else
()
find_package
(
Qt5Widgets REQUIRED
)
target_link_libraries
(
kalgebramobile Qt5::Widgets
)
endif
()
install
(
TARGETS kalgebramobile
${
KDE_INSTALL_TARGETS_DEFAULT_ARGS
}
)
...
...
mobile/main.cpp
View file @
be0eef9d
...
...
@@ -17,6 +17,10 @@
*************************************************************************************/
#include <QGuiApplication>
#ifndef Q_OS_ANDROID
#include <QApplication>
#include <QQuickStyle>
#endif
#include <KLocalizedContext>
#include <KLocalizedString>
...
...
@@ -38,11 +42,15 @@
Q_DECL_EXPORT
int
main
(
int
argc
,
char
*
argv
[])
{
#ifdef
_
_ANDROID
__
qputenv
(
"QT_QUICK_CONTROLS_STYLE"
,
"Material"
);
#ifdef
Q_OS
_ANDROID
QQuickStyle
::
setStyle
(
"Material"
);
#endif
QGuiApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
#ifdef Q_OS_ANDROID
QGuiApplication
app
(
argc
,
argv
);
#else
QApplication
app
(
argc
,
argv
);
#endif
KLocalizedString
::
setApplicationDomain
(
"kalgebramobile"
);
KAboutData
about
(
QStringLiteral
(
"kalgebramobile"
),
QStringLiteral
(
"KAlgebra"
),
QStringLiteral
(
KALGEBRA_VERSION_STRING
),
i18n
(
"A portable calculator"
),
KAboutLicense
::
GPL
,
i18n
(
"(C) 2006-2020 Aleix Pol i Gonzalez"
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment