Commit dda29726 authored by Fabian Vogt's avatar Fabian Vogt

Workaround bug in QT_QUICK_CONTROLS_1_STYLE usage in Qt

Summary:
Setting the style manually is necessary as there is only a variable that
applies to both quick controls versions, so it needs to be overwritten to not
cause a warning on every application start. The current way of setting it directly
got defeated by ugly bugs in QQuickControlSettings1, which need to be worked around.
See the added comments for an explanation.

Test Plan:
Set the variables manually, now works consistently everywhere without showing warnings.
For some reason I feel much dirtier now.

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7381
parent 30cd11c7
......@@ -97,9 +97,18 @@ export QT_AUTO_SCREEN_SCALE_FACTOR=0
#Set the QtQuickControls style to our own: for QtQuickControls1
#it will fall back to Desktop, while it will use our own org.kde.desktop
#for QtQuickControlsStyle and Kirigami
export QT_QUICK_CONTROLS_1_STYLE=Desktop
export QT_QUICK_CONTROLS_STYLE=org.kde.desktop
# For Qt Quick Controls 1, there is no style with that name,
# so override that explicitly with the default style to avoid
# a warning on startup. However, simply setting it to "Desktop" does
# not work, as QQuickControlSettings1 somehow messes that up and uses
# the parent directory as import path, resulting in the wrong style "Base"
# being used instead of the right one.
# We can work around that by supplying a relative path to a nonexistent
# directory, as it only looks at the file name in the end anyway...
export QT_QUICK_CONTROLS_1_STYLE=non/existent/dir/Desktop
# XCursor mouse theme needs to be applied here to work even for kded or ksmserver
if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
@EXPORT_XCURSOR_PATH@
......
......@@ -52,9 +52,18 @@ fi
#Set the QtQuickControls style to our own: for QtQuickControls1
#it will fall back to Desktop, while it will use our own org.kde.desktop
#for QtQuickControlsStyle and Kirigami
export QT_QUICK_CONTROLS_1_STYLE=Desktop
export QT_QUICK_CONTROLS_STYLE=org.kde.desktop
# For Qt Quick Controls 1, there is no style with that name,
# so override that explicitly with the default style to avoid
# a warning on startup. However, simply setting it to "Desktop" does
# not work, as QQuickControlSettings1 somehow messes that up and uses
# the parent directory as import path, resulting in the wrong style "Base"
# being used instead of the right one.
# We can work around that by supplying a relative path to a nonexistent
# directory, as it only looks at the file name in the end anyway...
export QT_QUICK_CONTROLS_1_STYLE=non/existent/dir/Desktop
#In wayland we want Plasma to use Qt's scaling
export PLASMA_USE_QT_SCALING=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment