Page 1 of 1

[Linux] Qt5 theme is reset when loading file again

Posted: Sat Jan 21, 2017 2:53 am
by pangwolin
This is in my current xnview.sh (starting script):

Code: Select all

export QT_DEBUG_PLUGINS=1
# this is needed to fix the font rendering issue
export QT_QPA_PLATFORMTHEME=qt5ct
# this doesn't work apparently
export QT_STYLE_OVERRIDE="Breeze"
I need qt5ct to override the default theme because I don't use a desktop environment (only i3 window manager) and it somehow fixes the font issues on Linux. It works fine... until I load a second file in xnviewmp.

Problem: When opening a file from a file manager, the qt5ct style is applied just fine (QtCurve) but whenever I load a new file (or simply try starting another instance of xnviewmp on top of the first one), the theme style gets reset to Qt5's Fusion (not XnViewMP's Fusion, the one that's shipped by default with Qt5 I believe).
I can't find a way around Qt5 resetting things all the time.

Can anyone confirm that QT_STYLE_OVERRIDE and/or -style=qtcurve is not supposed to work on xnviewmp? I've tried everything but they don't seem to change anything.
Does my thread make sense to you? Maybe it won't, in which case I might add more details later.

Re: [Linux] Qt5 theme is reset when loading file again

Posted: Fri Jan 27, 2017 1:17 am
by pangwolin
I understand what's going on now:

If the "Fusion" theme is selected in XnviewMP, it will override any theming done by the OS.

However, somehow in the latest version it's not working as it used to anymore. I can't apply the QtCurve theme anymore without losing the dark colors.

Not a big deal though, by using

Code: Select all

export QT_QPA_PLATFORMTHEME="kde"
instead of qt5ct seems to be ok still. What a mess this is!