You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You would need all plugins I would say. Plus QT_PLUGIN_PATH}/styles
Now there is a bit of a chicken and egg situation here. If you just add the ones which are installed on the machine the appimage gets packed, you will miss out some which are installed on the target system. You cannot guess which style/theme is used on the target systems. So if you do not ship with all, the appimage will look like an alien in some target systems.
So I guess its the best to have a list of all possible qt5 styles' and themes' .so files beforehand (the most common, I count 8 at archlinux wiki), and compare these with the ones installed in the qt5 installation of the machine the appimage gets packed, and then inform/warn the user of the fact that if he does not have all the platformthemes and styles installed in his plugins folder, that his app will not look right in different target systems.
If applicable, it would be wise to host these plugins here on github, (for each qt version I guess - or maybe one set of .so's work across more than one version/qtbase-abi...?), and insert them automatically.
Or provide a quick apt-get install or yum install list suggestion depending on the distro linuxdeployqt is run on, or maybe ask the user if linuxdeployqt itself should install these themes/styles via package system before building the appimage.
It is super important never to mix Qt versions. So if we bundle Qt (which we do) we must make sure that Qt themes are never loaded from the system or else we will crash. Check out the Krita AppImage, it ships with a dark Qt theme.
never loaded from the system or else we will crash.
I suspected that.
The way to solve it, from my point of view, is to ship the themes and styles, with ALL their dependencies, that is, you also will need to package GTK it you plan to also support libqgtk2.so (and related) themes.
That is for sure overkill for the average user, but some definitely strive to have a consistent desktop experience for their Apps, and a Dark theme does not necessarily help there.
What would be nice from a user perspective would be to have a possibility to ship the themes with all the dependencies if demanded, e.g. through an extra flag, and that the User is being hinted/warned that when generating the Appimage as it happens now, theme inconsistencies are gonna happen.
so for breeze, qtcurve, oxygen as default, one would have to ship parts of kde libs...
I now query the QT_QPA_PLATFORMTHEME variable of the system and then set the theme accordingly. But doing so, on a system where QT_QPA_PLATFORMTHEME is set to gtk2, and with the gtk2 platformtheme and style installed, results in this error (vanilla xubuntu 17.10 daily image)
QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.
QCommonStyle::drawComplexControl: Control 1 not handled
as well as this appearance:
instead of
If I try to install the qt5-gtk-platformtheme plugin via debian package in xubuntu 17.10, it shows these dependencies
I found elsewhere this answer to install libgnomeui-0 when searching for a solution to "could not resolve GTK".
So note: while xfce is a GTK-based desktop, it did NOT have the necessary libs shipped!
Obviously, when I try to install these on the target system via package-manager, the app tries to link against them, which results in a segfault. So I am not entirely shure about ABI stability helps here. So you will have to ship all these libs in the appimage for proper theming. You will have to rethink that anyways if you get kde-based themes into play, as well as qt5.8+ switching the theme /style plugins to gtk3...
Does not seem to be a trivial task, also given the fact that the machine where the appimage gets created would need to have all these installed..
Like I said before, the only Qt AppImages that follow my system theme are applications that have been built with GTK support and have an option to switch to GTK based theming. No other Qt AppImages follow my system theme.
gtkplatform is a Qt Platform Abstraction plugin providing Qt applications with the capability to use gtk+ as a host toolkit, primarily intended for use on Linux desktops.
That is: it lets Qt applications render with native gtk+ menus, and use gtk+ for input (mouse, keyboard, touch), and getting window content on screen, the same as it uses e.g. cocoa on macOS for instance.
Unfortunately it seems to be using the more complex and "moving target" Gtk+ 3 rather than the mature Gtk+ 2.
GTK+ 2 isn't mature btw, it's deprecated - the last release was 8 years ago. An application using GTK+ 2 now would look out of place in a modern desktop.
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.
The issue is that if you bundle QGnome, then you need to bundle all of its dependencies, too - since you can't assume Gnome to be present on all systems. And in practice, this can lead to all kinds of difficulties.
So over the years the contributors in this project have come to the conclusion that it's not worth the effort, but ymmv. You'd have to use another tool for that, though.
@probonopd I think you're confusing Qt platform themes with desktop environments. QGnomePlatform theme is quite lightweight and doesn't require any GNOME dependencies.
It is more a part of Qt rather than GNOME, so it depends on Qt.
It does depend on Gtk3 though
It also depends on gsettings schemas which is a small XML file it uses to get desktop settings over dbus which is a part of Qt.
There's also Adwaita-Qt which only depends on Qt
As you can see, there's nothing whatsoever that involves any of GNOME libraries other than Gtk3. And if Gtk3 is not present on target system, the platform plugin would just not load, so noop.
And if Gtk3 is not present on target system, the platform plugin would just not load, so noop.
if that is how it works, then it's good. But I remember that back in the time when we bundled Gtk Qt platform themes, we eventually ran into issues that made us decide it was not worth keeping them.
@probonopd It looks like the issue is not that Gtk is not present, but that it is loaded from the system and has incompatibility issues. Either it's a configuration issue or a binary incompatibility with bundled libraries. That's indeed a valid issue. Typically, AppImage doesn't load libraries and resources from the system. So this issue is not specific to the platform themes, but to any library that is loaded by AppImage from the system. Are there successful examples where AppImage loads a *.so from the system and it works?
Activity
vadi2 commentedon Feb 12, 2017
If this means my Qt application will look more native on a GTK sytem - yes, definitely.
probonopd commentedon Feb 12, 2017
Which of the platformthemes are the "standard" ones and should be copied in? Can you send a PR?
vadi2 commentedon Feb 19, 2017
I don't see such a folder in my Qt installation. I can't send a pr in, sorry.
revast commentedon Sep 26, 2017
libqgtk2.so to have a gtk look on qt5
revast commentedon Sep 26, 2017
You would need all plugins I would say. Plus QT_PLUGIN_PATH}/styles
Now there is a bit of a chicken and egg situation here. If you just add the ones which are installed on the machine the appimage gets packed, you will miss out some which are installed on the target system. You cannot guess which style/theme is used on the target systems. So if you do not ship with all, the appimage will look like an alien in some target systems.
So I guess its the best to have a list of all possible qt5 styles' and themes' .so files beforehand (the most common, I count 8 at archlinux wiki), and compare these with the ones installed in the qt5 installation of the machine the appimage gets packed, and then inform/warn the user of the fact that if he does not have all the platformthemes and styles installed in his plugins folder, that his app will not look right in different target systems.
If applicable, it would be wise to host these plugins here on github, (for each qt version I guess - or maybe one set of .so's work across more than one version/qtbase-abi...?), and insert them automatically.
Or provide a quick apt-get install or yum install list suggestion depending on the distro linuxdeployqt is run on, or maybe ask the user if linuxdeployqt itself should install these themes/styles via package system before building the appimage.
TheAssassin commentedon Sep 26, 2017
Can't Qt be made look for platform themes in one place and the rest in another? How do they solve it on Windows/macOS?
probonopd commentedon Sep 29, 2017
It is super important never to mix Qt versions. So if we bundle Qt (which we do) we must make sure that Qt themes are never loaded from the system or else we will crash. Check out the Krita AppImage, it ships with a dark Qt theme.
revast commentedon Sep 30, 2017
I suspected that.
The way to solve it, from my point of view, is to ship the themes and styles, with ALL their dependencies, that is, you also will need to package GTK it you plan to also support libqgtk2.so (and related) themes.
That is for sure overkill for the average user, but some definitely strive to have a consistent desktop experience for their Apps, and a Dark theme does not necessarily help there.
What would be nice from a user perspective would be to have a possibility to ship the themes with all the dependencies if demanded, e.g. through an extra flag, and that the User is being hinted/warned that when generating the Appimage as it happens now, theme inconsistencies are gonna happen.
probonopd commentedon Oct 1, 2017
No, since we consider Gtk+2 to be ABI stable and part of each target system.
So we would "only" have to bundle all Qt-GTK parts (libraries, plugins, themes, whatever is needed), if a certain extra flag was specified.
PR welcome!
revast commentedon Oct 3, 2017
libgtk2.0 is part of a kde-based distro?
ok, here are the dependecies of the platformthemes and styles:
libqgtk2.so
libqgtk2style.so
NEEDED libgtk-x11-2.0.so.0
NEEDED libgdk-x11-2.0.so.0
NEEDED libgdk_pixbuf-2.0.so.0
NEEDED libpango-1.0.so.0
NEEDED libgobject-2.0.so.0
NEEDED libglib-2.0.so.0
NEEDED libX11.so.6
NEEDED libQt5Widgets.so.5
NEEDED libQt5Gui.so.5
NEEDED libQt5Core.so.5
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libc.so.6
libqcleanlooksstyle.so
libqmotifstyle.so
libqplastiquestyle.so
NEEDED libQt5Widgets.so.5
NEEDED libQt5Gui.so.5
NEEDED libQt5Core.so.5
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libc.so.6
breeze.so
qtcurve.so
NEEDED libqtcurve-utils.so.2
NEEDED libKF5KDELibs4Support.so.5
NEEDED libKF5XmlGui.so.5
NEEDED libQt5PrintSupport.so.5
NEEDED libKF5IconThemes.so.5
NEEDED libQt5Svg.so.5
NEEDED libKF5ConfigWidgets.so.5
NEEDED libKF5GuiAddons.so.5
NEEDED libKF5WidgetsAddons.so.5
NEEDED libKF5WindowSystem.so.5
NEEDED libKF5ConfigCore.so.5
NEEDED libQt5DBus.so.5
NEEDED libQt5X11Extras.so.5
NEEDED libQt5Widgets.so.5
NEEDED libQt5Gui.so.5
NEEDED libQt5Core.so.5
oxygen.so
NEEDED libKF5Style.so.5
NEEDED libKF5WindowSystem.so.5
NEEDED liboxygenstyle5.so.5
NEEDED libxcb.so.1
NEEDED libKF5WaylandClient.so.5
NEEDED libKF5ConfigWidgets.so.5
NEEDED libKF5GuiAddons.so.5
NEEDED libQt5X11Extras.so.5
NEEDED libKF5ConfigGui.so.5
NEEDED libKF5ConfigCore.so.5
NEEDED libQt5Widgets.so.5
NEEDED libQt5DBus.so.5
NEEDED libQt5Gui.so.5
NEEDED libQt5Core.so.5
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libc.so.6
so for breeze, qtcurve, oxygen as default, one would have to ship parts of kde libs...
I now query the QT_QPA_PLATFORMTHEME variable of the system and then set the theme accordingly. But doing so, on a system where QT_QPA_PLATFORMTHEME is set to gtk2, and with the gtk2 platformtheme and style installed, results in this error (vanilla xubuntu 17.10 daily image)
as well as this appearance:
instead of
If I try to install the qt5-gtk-platformtheme plugin via debian package in xubuntu 17.10, it shows these dependencies
probonopd commentedon Oct 3, 2017
Try running with
LD_DEBUG=libs your.AppImageto see what is being loaded and what fails to load.revast commentedon Oct 4, 2017
https://pastebin.com/8bUR910v
notably, I have a
/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: error: symbol lookup error: undefined symbol: hb_font_funcs_set_variation_glyph_func (fatal)and it tries to find all the libs I get when installing libgnomeui-0, that is
libbonobo2-0 libbonobo2-common libbonoboui2-0 libbonoboui2-common libglade2-0 libgnome-2-0 libgnome-keyring-common libgnome-keyring0 libgnome2-common libgnomecanvas2-0 libgnomecanvas2-common libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-common liborbit-2-0I found elsewhere this answer to install libgnomeui-0 when searching for a solution to "could not resolve GTK".
So note: while xfce is a GTK-based desktop, it did NOT have the necessary libs shipped!
Obviously, when I try to install these on the target system via package-manager, the app tries to link against them, which results in a segfault. So I am not entirely shure about ABI stability helps here. So you will have to ship all these libs in the appimage for proper theming. You will have to rethink that anyways if you get kde-based themes into play, as well as qt5.8+ switching the theme /style plugins to gtk3...
Does not seem to be a trivial task, also given the fact that the machine where the appimage gets created would need to have all these installed..
probonopd commentedon Oct 4, 2017
I'm asking myself whether it's a good idea to depend on GNOME when all we (probably) really want is to render in Gtk+ 2.
What exactly pulls in libgnomeui-0?
26 remaining items
simoniz0r commentedon Dec 29, 2017
The same AppImage does not follow my system theme at all on LXQt.
https://transfer.sh/gjO1r/edb-qt56-continuous-git.6fcbf13-x86_64.AppImage
probonopd commentedon Dec 29, 2017
Strange. We still don't know why it is behaving so differently with different system/Qt combinations.
simoniz0r commentedon Dec 29, 2017
Like I said before, the only Qt AppImages that follow my system theme are applications that have been built with GTK support and have an option to switch to GTK based theming. No other Qt AppImages follow my system theme.
probonopd commentedon Dec 29, 2017
How does one do that?
simoniz0r commentedon Dec 29, 2017
Sorry, no idea on that one; I'm not a Qt dev... You might try asking someone like CDrummond who works on Cantata or the qxgedit developer.
probonopd commentedon Jan 20, 2019
What do people think of
https://github.com/CrimsonAS/gtkplatform?
Unfortunately it seems to be using the more complex and "moving target" Gtk+ 3 rather than the mature Gtk+ 2.
vadi2 commentedon Jan 20, 2019
Tried it out and it didn't work: CrimsonAS/gtkplatform#23
GTK+ 2 isn't mature btw, it's deprecated - the last release was 8 years ago. An application using GTK+ 2 now would look out of place in a modern desktop.
probonopd commentedon Jan 21, 2019
According to https://askubuntu.com/a/910143,
So, bundle the GTK2 platform theme and style?
probonopd commentedon Jan 21, 2019
Yes, that does the trick:
Vanuan commentedon Feb 20, 2023
As the AppImageKit issue closed, what's the status on this one?
Can platformthemes be bundled and how to make sure the version is compatible with the host version? Specifically QGnome
probonopd commentedon Feb 20, 2023
The issue is that if you bundle QGnome, then you need to bundle all of its dependencies, too - since you can't assume Gnome to be present on all systems. And in practice, this can lead to all kinds of difficulties.
So over the years the contributors in this project have come to the conclusion that it's not worth the effort, but ymmv. You'd have to use another tool for that, though.
Vanuan commentedon Feb 24, 2023
@probonopd I think you're confusing Qt platform themes with desktop environments. QGnomePlatform theme is quite lightweight and doesn't require any GNOME dependencies.
As you can see, there's nothing whatsoever that involves any of GNOME libraries other than Gtk3. And if Gtk3 is not present on target system, the platform plugin would just not load, so noop.
What difficulties you're talking about?
probonopd commentedon Feb 24, 2023
if that is how it works, then it's good. But I remember that back in the time when we bundled Gtk Qt platform themes, we eventually ran into issues that made us decide it was not worth keeping them.
If you are interested in the details:
AppImageCommunity/AppImageUpdate#150
Vanuan commentedon Feb 25, 2023
@probonopd It looks like the issue is not that Gtk is not present, but that it is loaded from the system and has incompatibility issues. Either it's a configuration issue or a binary incompatibility with bundled libraries. That's indeed a valid issue. Typically, AppImage doesn't load libraries and resources from the system. So this issue is not specific to the platform themes, but to any library that is loaded by AppImage from the system. Are there successful examples where AppImage loads a *.so from the system and it works?