AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.72k stars 559 forks source link

Qt applications ignore system font size preferences #125

Closed shoogle closed 1 year ago

shoogle commented 8 years ago

It seems that the version of Qt 5.5 currently available for CentOS 6 via EPEL (and therefore used for packaging all Qt AppImages made in CentOS 6) is not using the system font size on any distribution using GNOME or a related desktop environment, which makes text unreadable for users with large, high-resolution monitors. Setting the environment variable QT_STYLE_OVERRIDE=GTK+ seems to correct this behaviour. This line should be added to the AppRun launcher script for any Qt-based AppImages:

export QT_STYLE_OVERRIDE=GTK+ # use system font size

Doing this has either corrected the problem, or at least not made it worse, on every distro/desktop tested so far. Should it become apparent that a different solution is needed on certain desktops then they can be filtered by reading the XDG_CURRENT_DESKTOP environment variable.

RazZziel commented 8 years ago

What were the distros/desktops tested? I'm mostly worried about forcing GTK+ on KDE

probonopd commented 8 years ago

Is this limited to the version of Qt 5.5 currently available for CentOS 6 via EPEL? Is the behavior different e.g., in Qt 5.6?

shoogle commented 8 years ago

@probonopd Seems to be limited to Qt 5.5 via EPEL. Ubuntu's Qt 5.4, and Qt 5.5 direct from http://www.qt.io/ don't have the problem.

@RazZziel From my tests, and thanks to those who report at https://musescore.org/en/node/104106

OS/Desktop Font behaviour without QT_STYLE_OVERRIDE=GTK+ Font behaviour with QT_STYLE_OVERRIDE=GTK+
Ubuntu/Unity Incorrect (didn't obey system settings) Correct (obeys system settings)
Ubuntu/XFCE Incorrect Correct
Debian/GNOME Partially correct Correct
ArchLinux/MATE Incorrect Correct
ArchLinux/LXDE Incorrect Incorrect
openSUSE/KDE Correct Correct

So setting QT_STYLE_OVERRIDE=GTK+ never made it worse, and in most cases completely fixed it.

If setting it on KDE still worries you, you could do:

if [ "${XDG_CURRENT_DESKTOP}" != "KDE" ]; then
  export QT_STYLE_OVERRIDE=GTK+
fi
probonopd commented 8 years ago

Wouldn't it be better to just use a different Qt then?

Krita seems to be going down that path. Might also solve https://github.com/probonopd/AppImages/issues/27 while we are at it.

Unfortunately I don't have the time right now to try it out, and I fear that re-building Qt from source each time will easily exceed the Travis build time limit... so we need to build/find a better Qt for CentOS 6?

crayxt commented 8 years ago

http://koji.fedoraproject.org/koji/buildinfo?buildID=746785 it seems like Qt 5.6 is coming to EPEL6

RazZziel commented 8 years ago

Unfortunately I don't have the time right now to try it out, and I fear that re-building Qt from source each time will easily exceed the Travis build time limit... so we need to build/find a better Qt for CentOS 6?

In any case IMHO rebuilding Qt should be the applications responsibility, not the container's; AppImageKit itself doesn't use Qt at all. Each application should pack the version of Qt that better suits its needs, there's no reason for the container to select Qt5.6 i.e. for an app that has only been tested and validated in Qt5.2.

shoogle commented 8 years ago

I think it makes sense to put this here because it will get seen by projects using Qt in AppImages. I'm not blaming AppImageKit for problems in Qt via EPEL ;)

Upgrading to Qt 5.6 from EPEL might not fix this problem if it is caused by the EPEL packaging. It might be necessary to get it somewhere else instead of EPEL, we'll have to wait and see. In the meantime, setting that environment variable really isn't very hard to do.

estan commented 7 years ago

The fact that Qt can normally pick up KDE's font settings is because the KDE platform theme plugin (KDEPlatformTheme.so) is used, isn't it? So to get an AppImage that bundles Qt to respect the KDE font settings, you would also need to bundle that plugin (including a truckload of KF5 dependencies).

I did a quick test, running my AppImage on a Kubuntu Xenial desktop. It does not respect KDE's font settings, which is to be expected (printing QFontDatabase::systemFont(QFontDatabase::GeneralFont) gives QFont( "Sans Serif,9,-1,5,50,0,0,0,0,0" )).

But if I do this hacky maneuver:

mkdir ~/foo/platformthemes
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlatformTheme.so ~/foo/platformthemes
QT_PLUGIN_PATH=~/foo ./myapp.AppImage

Then it'll respect the KDE settings (QFontDatabase::systemFont(QFontDatabase::GeneralFont) now reports QFont( "Noto Sans,10,-1,0,50,0,0,0,0,0" ) instead, which is correct). The above is not a proper solution of course.

I think in general (but I'm not sure), for Qt to pick up font settings from KDE/GNOME, it needs the proper platform theme plugin.

estan commented 7 years ago

(To clarify: The above is not a proper solution, even if you'd bake some logic into your AppRun to make it load the host system's KDEPlatformTheme.so when in a KDE session, since that plugin was built against the system's Qt, while your AppImage could conceivably bundle a Qt that is too new to be ABI compatible. My hack above only worked because the Kubuntu Qt 5.5.1 is ABI compatible with the 5.6.1 I was bundling.)

estan commented 7 years ago

A solution, if all you're interested in is respecting the KDE/GNOME font settings, might be to make a really lightweight Qt platform theme plugin which only supports reporting font settings and changes to font settings, and bundle that. I might experiment with that actually (though only KDE since I don't have GNOME available).

estan commented 7 years ago

Finally, I think the fact that it seems to "work" in some cases might just be that "Sans Serif" happen to map to whatever was the font settings on the platform. Try printing QFontDatabase::systemFont(QFontDatabase::GeneralFont) to see if it really picked up the font settings.

probonopd commented 7 years ago

@estan

A solution, if all you're interested in is respecting the KDE/GNOME font settings, might be to make a really lightweight Qt platform theme plugin which only supports reporting font settings and changes to font settings, and bundle that.

Wow. I think this should go into Qt upstream. It's not only affecting AppImages but all sorts of applications that bundle their private copy of Qt (as many do).

estan commented 7 years ago

Wow. I think this should go into Qt upstream. It's not only affecting AppImages but all sorts of applications that bundle their private copy of Qt (as many do).

Well, looking at the code for the KDE platform theme plugin, such a minimal plugin would (for the KDE case) need to link at least KF5::ConfigCore, and I guess the Qt devs wouldn't want to do that. I also don't think they'll want to write their own code to parse KDE/GNOME settings, as the format of those might change.

I think the design is that, if no platform theme plugin suited for the current desktop session is found, Qt uses its own, which obviously doesn't know about KDE/GNOME settings, and the idea is that if you want proper integration, you install the platform theme plugin for the respective platform.

But I'm no Qt dev, so what do I know :)

It should be possible to bundle the KDE platform plugin in your AppImage, but it brings in quite a bit of KF5 dependencies [1], which is a bit heavy if all you're after is the font settings (which would only bring in KF5::ConfigCore AFAICS).

In my image I'm actually bundling the Breeze Qt style plugin + its KF5 dependencies, because my primary target machines are running Plasma, and I wanted the correct look there. It grew my image by about 7 MB, which is quite a bit, but OK in my case.

I'll see if I can create a minimal KDE platform theme plugin that just has the font settings integration though. For GNOME, someone else will have to do it, as I don't have GNOME at hand (and not very good with its APIs).

[1] KF5::ConfigWidgets, KF5::ConfigCore, KF5::IconThemes, KF5::KIOFileWidgets, KF5::KIOWidgets, KF5::XmlGui, KF5::I18n, KF5::Notifications from the looks of it.

probonopd commented 7 years ago

Thanks for the detailed explanation @estan. I am also not a Qt developer but I think they should do native GTK and KDE platform plugins, so that applications behave truly natively. In the meantime, I am looking forward to your solution.

estan commented 7 years ago

Hm yes, thinking about it a bit more, I think you're right. It fits with the purpose of Qt. They do respect Windows' font settings after all.

I'll see if there's maybe a bug report at Qt about this.

In the meantime, I might make a fork of https://github.com/KDE/plasma-integration and brutally hack it to only include the font integration.

estan commented 7 years ago

I guess the problem might be that on Linux, there are many desktop environments (even if KDE and GNOME are the biggest), and how they store the font settings is different. On Windows and MacOS, it's monolithic, and they can use the system libraries to read font settings. On Linux, they'd need to link KDE libraries, GNOME libraries, et.c. to read the settings properly (or do the parsing themselves and risk it breaking), and I don't think they want Qt to depend on those libraries.

estan commented 7 years ago

For what it's worth, I forked plasma-integration and ripped out some things to cut down on the number of KF5 dependencies (notably the KDE native file dialog, which would have brought in KIO and a lot of other stuff). The branch is here: https://github.com/estan/plasma-integration/tree/mini

With this platform theme plugin bundled, my AppImage will respect KDE font and color scheme settings, as well as some other small settings. (I'm actually also bundling the Breeze theme plugin, since Plasma is a major target platform for me).

This platform theme plugin is highly unofficial of course, so if you want something supported, you should bundle the full thing.

@probonopd: Regarding your question "Is this limited to the version of Qt 5.5 currently available for CentOS 6 via EPEL? Is the behavior different e.g., in Qt 5.6?". I saw the problem with Qt 5.6.1 (from EPEL).

And also, I think you're right, this should be reported as a bug in Qt, because it does in fact have some general platform theme plugins for GNOME / KDE built in, which its XCB platform plugin falls back to if no platform theme plugin is chosen (see http://code.qt.io/cgit/qt/qtbase.git/tree/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp). It just seems the one for KDE isn't doing a good job when it comes to fonts.

In any case, I don't think this is a bug with AppImageKit, so this issue should probably be closed.

probonopd commented 7 years ago

Thanks @estan this is a highly relevant contribution. Any chance that you will offer a deb or repo (ppa) for it?

estan commented 7 years ago

@probonopd: Well, I consider it mostly a hack, so I don't really want to turn it into something official looking. The proper thing to do if you want full KDE integration is to bundle the full KDEPlasmaPlatformTheme.so installed by the official plasma-integration as it is. For me, I didn't feel like I needed the KDE native file dialog or the systray integration, so those were the things I stripped out (and Wayland support, since my app is X11 only), in order to reduce dependencies.

And Qt should fix/improve its internal KdeTheme in qgenericunixtheme.cpp that it falls back to in the absense of a platform theme, since the KDE font settings integration seems broken (perhaps it's getting some settings paths wrong?). It actually tries to manually parse the KDE settings, something I didn't think it did.

And aren't most people building their AppImages on CentOS? Then a .deb / PPA wouldn't be too useful I think.

Here are some parts from the Dockerfile for the CentOS 6.7 image in which I build my AppImage showing how I build Breeze + dependencies and my hacked plasma-integration + dependencies.

# Version of Plasma dependencies
ENV PLASMA_VERSION 5.9.3

# Version of KF5 dependencies
ENV KF5_VERSION 5.32.0

# Build and install Extra CMake Modules
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/extra-cmake-modules-${KF5_VERSION}.tar.xz && \
    tar xvf extra-cmake-modules-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/extra-cmake-modules-${KF5_VERSION}/build
WORKDIR /tmp/extra-cmake-modules-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KWindowSystem
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kwindowsystem-${KF5_VERSION}.tar.xz && \
    tar xvf kwindowsystem-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kwindowsystem-${KF5_VERSION}/build
WORKDIR /tmp/kwindowsystem-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KConfig
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kconfig-${KF5_VERSION}.tar.xz && \
    tar xvf kconfig-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kconfig-${KF5_VERSION}/build
WORKDIR /tmp/kconfig-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KGuiAddons
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kguiaddons-${KF5_VERSION}.tar.xz && \
    tar xvf kguiaddons-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kguiaddons-${KF5_VERSION}/build
WORKDIR /tmp/kguiaddons-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KCodecs
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kcodecs-${KF5_VERSION}.tar.xz && \
    tar xvf kcodecs-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kcodecs-${KF5_VERSION}/build
WORKDIR /tmp/kcodecs-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KWidgetsAddons
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kwidgetsaddons-${KF5_VERSION}.tar.xz && \
    tar xvf kwidgetsaddons-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kwidgetsaddons-${KF5_VERSION}/build
WORKDIR /tmp/kwidgetsaddons-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KCoreAddons
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kcoreaddons-${KF5_VERSION}.tar.xz && \
    tar xvf kcoreaddons-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kcoreaddons-${KF5_VERSION}/build
WORKDIR /tmp/kcoreaddons-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KItemViews
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kitemviews-${KF5_VERSION}.tar.xz && \
    tar xvf kitemviews-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kitemviews-${KF5_VERSION}/build
WORKDIR /tmp/kitemviews-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KAuth
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kauth-${KF5_VERSION}.tar.xz && \
    tar xvf kauth-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kauth-${KF5_VERSION}/build
WORKDIR /tmp/kauth-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KI18n
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/ki18n-${KF5_VERSION}.tar.xz && \
    tar xvf ki18n-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/ki18n-${KF5_VERSION}/build
WORKDIR /tmp/ki18n-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_WITH_QTSCRIPT=NO -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KConfigWidgets
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kconfigwidgets-${KF5_VERSION}.tar.xz && \
    tar xvf kconfigwidgets-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kconfigwidgets-${KF5_VERSION}/build
WORKDIR /tmp/kconfigwidgets-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KArchive
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/karchive-${KF5_VERSION}.tar.xz && \
    tar xvf karchive-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/karchive-${KF5_VERSION}/build
WORKDIR /tmp/karchive-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KPackage
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kpackage-${KF5_VERSION}.tar.xz && \
    tar xvf kpackage-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kpackage-${KF5_VERSION}/build
WORKDIR /tmp/kpackage-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install Breeze
WORKDIR /tmp
RUN wget https://download.kde.org/stable/plasma/${PLASMA_VERSION}/breeze-${PLASMA_VERSION}.tar.xz && \
    tar xvf breeze-${PLASMA_VERSION}.tar.xz && \
    mkdir /tmp/breeze-${PLASMA_VERSION}/build
WORKDIR /tmp/breeze-${PLASMA_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DWITH_DECORATIONS=OFF -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install KIconThemes
WORKDIR /tmp
RUN wget https://download.kde.org/stable/frameworks/5.32/kiconthemes-${KF5_VERSION}.tar.xz && \
    tar xvf kiconthemes-${KF5_VERSION}.tar.xz && \
    mkdir /tmp/kiconthemes-${KF5_VERSION}/build
WORKDIR /tmp/kiconthemes-${KF5_VERSION}/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=NO .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install && \
    ldconfig

# Build and install unofficial mini version of KDE Plasma platform theme plugin
WORKDIR /tmp
RUN wget https://github.com/estan/plasma-integration/archive/v${PLASMA_VERSION}-mini.tar.gz && \
    tar xvf v${PLASMA_VERSION}-mini.tar.gz && \
    mkdir /tmp/plasma-integration-${PLASMA_VERSION}-mini/build
WORKDIR /tmp/plasma-integration-${PLASMA_VERSION}-mini/build
RUN cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. && \
    cmake3 --build . -- -j6 && \
    cmake3 --build . --target install

EDIT: Oops, realized just now that I'm not using the KF5_VERSION variable I added in the directory part of the KF5 URLs above. I should fix that.

probonopd commented 7 years ago

Cool stuff @estan - is your AppImage available for download?

estan commented 7 years ago

@probonopd: It's a closed source application for work unfortunately :(

estan commented 7 years ago

But the above is the gist of it. I then install the platform theme plugin and Breeze theme plugin with

# Install Breeze Qt style plugin
cp /usr/lib64/plugins/styles/breeze.so $APPDIR/usr/lib/qt5/plugins/styles/

# Install mini version of KDE Plasma platform theme plugin
cp /usr/lib64/plugins/platformthemes/KDEPlasmaPlatformThemeMini.so $APPDIR/usr/lib/qt5/plugins/platformthemes/

in my AppImage building script (and their deps to $APPDIR/usr/lib of course).

probonopd commented 7 years ago

@estan thanks. Even if it's closed source, feel free to add it to the list at https://github.com/probonopd/AppImageKit/wiki/AppImages if you like.

estan commented 7 years ago

@probonopd Ah yes, I might do that in the future. It's not a general purpose application though. It's a tool for looking at the results coming from an analysis machine we're developing, so the tool will only be delivered together with the machine. And it's not released yet. It's under development and only tested internally and by a few prospective customers. We're deploying it through our own APT repository at the moment, so I'm only experimenting with AppImage so far (great job BTW, I love the simplicity!).

estan commented 7 years ago

And since people may be interested: Adding Breeze + dependencies and my custom Plasma platform theme plugin + dependencies increases my AppImage size by ~8 MB compared to when I had no KF5 dependencies in it. Adding just the platform theme + dependencies would be a bit less than that, but not much less.

probonopd commented 6 years ago

I am sure we can do better than this for a Qt 5.9 application on Ubuntu 17.10:

But what, exactly, do we need to do?

export QT_STYLE_OVERRIDE=GTK+ prior to running the AppImage doesn't seem to make a visual difference.

probonopd commented 6 years ago

Interesting: The AppImages from https://download.opensuse.org/repositories/home:/rncbc/AppImage/ look correctly themed on XFCE:

qt

Despite no platformthemes bundled:

me@host:~$ strace -f squashfs-root/AppRun 2>&1 | grep -e platformtheme
[pid 31050] stat("/home/me/squashfs-root/usr/plugins/platformthemes/.", 0x7ffd7d15fdd0) = -1 ENOENT (No such file or directory)
[pid 31050] stat("/home/me/squashfs-root/usr/bin/platformthemes/.", 0x7ffd7d15fdd0) = -1 ENOENT (No such file or directory)

But it has Gtk+ related stuff baked in:

me@host:~$ strings squashfs-root/usr/lib/libQt5Widgets.so.5 | grep gtk_ | wc -l
89

Whereas the one bundled with Subsurface doesn't have that:

me@host:~$ strings squashfs-root/usr/lib/libQt5Widgets.so.5 | grep gtk_ | wc -l
0

It's a shame! The newer Qt got worse?

azubieta commented 5 years ago

Please move to the linuxdeploy-plugin-qt repository.

probonopd commented 5 years ago

Can't move there because it's in a different organization.

azubieta commented 5 years ago

Closing as it was moved to linuxdeploy-plugin-qt

probonopd commented 5 years ago

According to https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications#QGtkStyle,

QGtkStyle has been removed from qt5-base 5.7.0 and added to qt5-styleplugins.

And ever since Qt applications have been looking ugly on Gtk+ based systems.

usr/lib/qt/plugins/styles/libqgtk2style.so
usr/lib/qt/plugins/platformthemes/libqgtk2.so

So we need to find a suitable implementation of those and use them.

probonopd commented 5 years ago

A quick test to see if you have a version of Qt that can deal with Gtk+ or not.

With an older Qt 5:

me@host:~$ strings AppDir/usr/lib/libQt5Widgets.so.5  | grep GTK
GTK+
GTK+ does not allow this therefore Qt cannot use the GTK+ integration.
QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.

With a newer Qt 5:

me@host:~$ strings /tmp/.mount_mu-imaNz9jcr/usr/lib/libQt5Widgets.so.5 | grep GTK
(nothing)

This is why I don't like the concept of plugins and the concept of "separating xyz". It was integral part of Qt and it "just worked". Then they decided to move it somewhere else, and since it is broken and requires extra work to get going.

probonopd commented 5 years ago

Closing as it was moved to linuxdeploy-plugin-qt

It is affecting linuxdeployqt, too, hence reopening here until it is sufficiently addressed everywhere.

Vanuan commented 4 years ago

So, how the solution could look like? Some configurator app which allows you to install Qt platform theme plugins?

Vanuan commented 4 years ago

Does AppImage have access to DBus? If yes, you could include this https://github.com/FedoraQt/QGnomePlatform This wouldn't get you styles, but at least it would be a correct font.

probonopd commented 4 years ago

Check this out: https://github.com/FreeCAD/FreeCAD-AppImage/issues/38

Possibly bundling QGnomePlatform and/or qt5-gtk-platformtheme inside the AppImage may solve this.

The applications inside an AppImage do have access to DBus, as AppImage is just a self-mounting filesystem. There is no sandboxing applied unless the user explicitly sets something up like Firejail.

Vanuan commented 4 years ago

@probonopd what do you mean "check this out"? That's my message on the forum :)

probonopd commented 4 years ago

Ah sorry @Vanuan I didn't realize that :)

So yes, possibly(!) bundling QGnomePlatform and/or qt5-gtk-platformtheme inside the AppImage may solve this. Should be tested by someone who has the time to test it.

Personally, I have had good results with the GTK+ 2 Platform theme for Qt (3 never seemed to work entirely without 2 also being installed).

Also see https://github.com/probonopd/linuxdeployqt/issues/60, specifically https://github.com/probonopd/linuxdeployqt/issues/60#issuecomment-456185392.

Vanuan commented 4 years ago

@probonopd

Personally, I have had good results with the GTK+ 2 Platform theme for Qt (3 never seemed to work entirely without 2 also being installed).

On some systems, gtk2 + gtk3 works, on others QGnomePlatform + adwaita style plugin do the trick. I think it has something to do with Qt version but not sure how exactly. The main issue, of course is the font size. So maybe bundling all three: gtk2, gtk3 and QGnomePlatform is required.

Besides that, it's required to figure out the QT_QPA_PLATFORMTHEME variable. That is, how to set it to gtk3, gnome or any other value depending on the system we're running on.

Vanuan commented 4 years ago

Some library info:

ldd /usr/local/Qt-5.13.2/plugins/platformthemes/libqgnomeplatform.so 
        linux-vdso.so.1 (0x00007ffdab52a000)
        libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f11f7a84000)
        libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007f11f778d000)
        libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f11f7580000)
        libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f11f7334000)
        libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f11f710e000)
        libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f11f6f05000)
        libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f11f6bf1000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f11f69cd000)
        libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f11f6637000)
        libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f11f63e4000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f11f60d0000)
        libQt5Widgets.so.5 => /usr/local/Qt-5.13.2/lib/libQt5Widgets.so.5 (0x00007f11f587c000)
        libQt5Gui.so.5 => /usr/local/Qt-5.13.2/lib/libQt5Gui.so.5 (0x00007f11f507b000)
        libQt5DBus.so.5 => /usr/local/Qt-5.13.2/lib/libQt5DBus.so.5 (0x00007f11f4dee000)
        libQt5Core.so.5 => /usr/local/Qt-5.13.2/lib/libQt5Core.so.5 (0x00007f11f463c000)
        libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f11f43ca000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f11f41ad000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f11f3e2b000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f11f3b27000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f11f3910000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f11f3571000)
        libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f11f336d000)
        libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f11f302d000)
        libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f11f2e1d000)
        libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f11f2c1a000)
        libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f11f2a17000)
        libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f11f2811000)
        libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007f11f25e2000)
        libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f11f23a2000)
        libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007f11f219a000)
        libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007f11f1f98000)
        libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007f11f1d89000)
        libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007f11f1a93000)
        libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f11f187d000)
        libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f11f163f000)
        libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x00007f11f139b000)
        libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f11f1198000)
        libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f11f0f8d000)
        libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f11f0d82000)
        libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f11f0b70000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f11f0968000)
        libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f11f0766000)
        libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f11f055c000)
        libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f11f02b5000)
        libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f11f0082000)
        libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f11efe7e000)
        libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f11efc56000)
        libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f11efa48000)
        libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f11ef83e000)
        libz.so.1 => /usr/local/hdf5/lib/libz.so.1 (0x00007f11ef624000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f11ef3fc000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f11ef1e5000)
        libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f11eef97000)
        libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f11eed8e000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f11eeb1b000)
        libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f11ee8cb000)
        libicui18n.so.57 => /usr/lib/x86_64-linux-gnu/libicui18n.so.57 (0x00007f11ee450000)
        libicuuc.so.57 => /usr/lib/x86_64-linux-gnu/libicuuc.so.57 (0x00007f11ee0a8000)
        libicudata.so.57 => /usr/lib/x86_64-linux-gnu/libicudata.so.57 (0x00007f11ec62b000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f11ec427000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f11f85f4000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f11ec1fd000)
        libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f11ebffa000)
        libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f11ebdf7000)
        libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f11ebbf0000)
        libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f11eb9ee000)
        libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f11eb7bf000)
        libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f11eb5bd000)
        libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f11eb3a2000)
        libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f11eb19d000)
        libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f11eaf97000)
        libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f11ead87000)
        libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007f11eab56000)
        libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f11ea8c1000)
        libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f11ea6b9000)
        libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f11ea4b5000)
        libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f11ea2af000)
        libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f11ea069000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f11f874f000)
        libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f11e9e3c000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f11e9c26000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f11e9a21000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f11e97fb000)
        liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f11e95e9000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f11e92d9000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f11e90c5000)
ldd ../libqgtk3.so 
        linux-vdso.so.1 (0x00007ffe5d092000)
        libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f2d969bd000)
        libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007f2d966c6000)
        libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f2d9647a000)
        libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f2d96227000)
        libQt5DBus.so.5 => /usr/local/Qt-5/lib/libQt5DBus.so.5 (0x00007f2d95f9a000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2d95c86000)
        libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f2d95946000)
        libQt5Gui.so.5 => /usr/local/Qt-5/lib/libQt5Gui.so.5 (0x00007f2d95145000)
        libQt5Core.so.5 => /usr/local/Qt-5/lib/libQt5Core.so.5 (0x00007f2d94993000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2d94611000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2d94272000)
        libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f2d9406e000)
        libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f2d93e61000)
        libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f2d93c51000)
        libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f2d93a4e000)
        libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f2d9384b000)
        libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f2d93645000)
        libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f2d9343c000)
        libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f2d93128000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f2d92f04000)
        libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f2d92cde000)
        libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007f2d92aaf000)
        libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f2d9286f000)
        libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007f2d92667000)
        libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007f2d92465000)
        libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007f2d92256000)
        libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007f2d91f60000)
        libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f2d91d4a000)
        libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f2d91b0c000)
        libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x00007f2d91868000)
        libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f2d914d2000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2d911ce000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2d90fb1000)
        libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f2d90dae000)
        libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f2d90ba3000)
        libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f2d90998000)
        libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f2d90786000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2d9057e000)
        libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f2d9037c000)
        libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f2d90172000)
        libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f2d8ff69000)
        libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f2d8fd19000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2d8fb02000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f2d8f88f000)
        libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f2d8f667000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2d8f463000)
        libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f2d8f1f1000)
        libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f2d8efbe000)
        libz.so.1 => /usr/local/hdf5/lib/libz.so.1 (0x00007f2d8eda4000)
        libicui18n.so.57 => /usr/lib/x86_64-linux-gnu/libicui18n.so.57 (0x00007f2d8e929000)
        libicuuc.so.57 => /usr/lib/x86_64-linux-gnu/libicuuc.so.57 (0x00007f2d8e581000)
        libicudata.so.57 => /usr/lib/x86_64-linux-gnu/libicudata.so.57 (0x00007f2d8cb04000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2d972d3000)
        libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f2d8c85d000)
        libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f2d8c659000)
        libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f2d8c44b000)
        libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f2d8c241000)
        libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007f2d8c010000)
        libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f2d8bd7b000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f2d8bb51000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f2d8b929000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f2d8b712000)
        libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f2d8b4c4000)
        libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f2d8b2bc000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f2d973e1000)
        libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f2d8b0b8000)
        libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f2d8aeb2000)
        libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f2d8acaf000)
        libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f2d8aaac000)
        libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f2d8a8a5000)
        libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f2d8a6a3000)
        libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f2d8a474000)
        libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f2d8a272000)
        libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f2d8a057000)
        libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f2d89e52000)
        libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f2d89c4c000)
        libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f2d89a3c000)
        libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f2d8980f000)
        libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f2d895c9000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f2d893a3000)
        liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f2d89191000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f2d88e81000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f2d88c6b000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f2d88a66000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f2d88852000)
ghost commented 1 year ago

Possibly bundling QGnomePlatform and/or qt5-gtk-platformtheme inside the AppImage may solve this.

So, is there any successful example of Qt-based app AppImage that has it bundled in and follows system font size?

Also, is it possible add export QT_FONT_DPI={value} into AppRun and getactual system font size as DPI {value) at least on each launch? (somehow, maybe with additional Shell-scipt which would seats between AppRun and main executable or be a part of AppRun itself)

Vanuan commented 1 year ago

@Symbian9 I was able to build a FreeCAD AppImage with QGnomePlatform and setting QT_QPA_PLATFORMTHEME=gnome manually. I could find a script I need to modify to do it though.

probonopd commented 1 year ago

Can this be closed? There is nothing in the AppImage format that deals with fonts. Whatever the issue is, it must be on the level of the payload inside a particular AppImage (or the tools that were used to create it).