Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section on how to make AppImages of Qt apps look native on Gtk #50

Open
probonopd opened this issue Jul 30, 2020 · 0 comments
Open

Comments

@probonopd
Copy link
Member

probonopd commented Jul 30, 2020

Add section on how to make AppImages of Qt apps look native on Gtk based on

Proposal:

Making AppImages of Qt apps look native on Gtk

Here is an example of a native-looking Qt application running on a Xubuntu (Xfce-based) distribution in an AppImage:

image

To make AppImages of Qt applications look native on Gtk based systems, you need to bundle plugins/platformthemes/libqgtk2.so and plugins/styles/libqgtk2style.so. Since they do not come with Qt by default anymore, you need to compile them by hand.

Example:

apt-get update
apt-get -y install libgtk2.0-dev
git clone http://code.qt.io/qt/qtstyleplugins.git
cd qtstyleplugins
qmake
make -j$(nproc)
make install 
cd -

(...)

linuxdeployqt (...) -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so

At runtime, you need to export QT_QPA_PLATFORMTHEME=gtk2, e.g., by adding this line to a custom AppRun script. (Xubuntu exports this variable automatically).

Background information

According to https://askubuntu.com/a/910143,

The problem has occurred since Qt5.7. In this release, the GTK2 platform theme and style was removed and replaced with the GTK3 platform theme. I've recently been in discussion with the Qt developers and it appears there isn't a GTK3 style to complement the platform theme and there are currently no plans to implement this in the future.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant