-
Notifications
You must be signed in to change notification settings - Fork 744
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
GTK and Native styles not available #306
Comments
Hey Yeah, if IIRC then there were some problems in Qt 5.6.x and 5.7.x because of the change from gtk2 to gtk3 or something. And therefore the But since you are on 5.8 and you also have found the It could be that However, I will look into that tomorrow and try to reproduce it.
Did you already tried to set the Here are some related infos (some may be for some other distros) https://github.com/manjaro/release-plan/issues/73 |
Thanks for the reply! Another thing I noticed is that when I don't try to set the style at all (no I tried
This function: EDIT: The |
Okay, looked into it on Mint 18.1 Cinnamon, but I couldn't find a solution. Like you, I always only get But it seems like this is not an issue that is limited to Mint, but it rather affects a range of distros. I also read somewhere, that the However, it seems like there is not much that I can do at this point. |
It makes sense that the Distro maintainers have patched the Qt libs to properly support GTK styling, because all applications in the repositories also use the Qt libs from the repositories. Is there no way for Go Qt to also use the native libs? It's kind of frowned upon for package maintainers to ship custom versions of libs that are already in the repositories. The deb linter even gives a warning when installing a package that ships vendored Qt libs (last time I tried it, at least). I'll try Qt 5.6.2 when I find the time. I hope this will be fixed in 5.9, or I may have to stick to 5.6.2 forever (until it's fixed at least). There also this other Qt binding: https://github.com/visualfc/goqt. It's pretty outdated and lacks a lot of features, but it does properly apply the GTK style without workarounds, maybe you can get some inspiration from there :). He's taking a different approach though, he wrote his own SO library that interfaces between Go and the system Qt libs. |
You can use your system package managers Qt libs by exporting However, I tried to get it working on Mint 18.1 with the system Qt libs, but it didn't worked out because they still only provide Qt 5.5.x libs and the binding is only backward compatible with Qt version >= 5.6.x. I also tried it with the Qt 5.8.x libs from |
Mh, then you probably need to start the binary directly if you use QT_PKG_CONFIG, not like usual with the *.sh. Or maybe try to remove the line containing
Yeah, QT_PKG_CONFIG is intended to be used if you want to create applications for your package manager. So your applications will work on all the other Arch systems with Qt 5.9.1, but not on some other distro. If you want a portable application, then you need to use the official Qt version with the broken styling :( Or the old 5.6.2 version, where the styling still works. |
Hey @therecipe @Fornax96, it seems Qt already abandoned development of GTK style binding for Qt. Even in latest documentation for
|
@RadhiFadlillah Thanks for the info :) It's probably to time consuming to get it working on all the different distros ... |
That commit is for the GTK3 plugin. GTK2 is currently still supported, but the GTK developers are phasing it out in favor of GTK3, which has been declared stable for a while now. If they really plan to abandon the GTK style plugin that will probably break a whole lot of apps. I already have dozens of Qt apps on my PC that use GTK style (VLC, Zim, KeePassX, etc). I think it's very likely that the plugin will continue to be maintained by the community because it's required to make the gnome desktop (and derivatives) look consistent. Without it the Qt apps look awkward and out of place on most Linux-based operating systems. I know that Qt is the native GUI toolkit for KDE, I wonder how they handle styling. In the end it's probably easier to implement your own dark and light themes and make it configurable, than to rely on style plugins. Probably what I will be doing. |
@Fornax96 have you tried deploying using docker image ? I am using Go 1.8.3 on Manjaro Linux with Arc theme. When I try to deploy my app using locally installed Qt ( But when I deploy my app using docker image ( |
To be honest, I have no idea how docker works or how to use it. I thought it was kind of like virtutalbox. I've been doing tons of research, reading through mailing lists and browsing through repositories. Eventually I found out that gtk2 style has been deprecated from Qt Base and was moved to qtstyleplugins for compatibility: https://github.com/qt/qtstyleplugins/tree/master/src/plugins/styles/gtk2. In Qt Base gtk2 style has been replaced by gtk3 style in 5.7, which can be found in the repository: https://github.com/qt/qtbase/tree/5.7/src/plugins/platformthemes/gtk3. This is great, it means that gtk3 style should be natively supported from 5.7 and up. The bad news is that most stable (debian-based) distros are stuck on 5.5.X, where gtk2 has been moved to qtstyleplugins and gtk3 has not been implemented yet, so there's no way to support native styles. I guess all we can do is wait until the repository maintainers have caught up. EDIT: Ugh, apparently in Qt a "style" is completely different than a "theme". A theme is just the icons, fonts and cursors in the application, while the style paints the widgets and such. This means the gtk style is not supported in 5.7 and up :( My guess is that this is why the stable distros are not updating their Qt installations. And I guess distros that do support it enable the plugin themselves. |
I noticed that applications built with these bindings use Fusion style by default instead of the native style, so I was trying to set it to GTK manually with this line of code:
widgets.QApplication_SetStyle2("GTK")
. But when I execute it it only prints this message to stdout:QApplication: invalid style override passed, ignoring it.
. When I print the available styles it only shows Windows and Fusion.I am using Go 1.8.1 and Qt 5.8 on Linux Mint 18 Cinnamon with the Mint-Y-Dark theme.
In my Qt install directory I can see that libqgtk3.so is present in
plugins/platformthemes
. When I run my application withQT_DEBUG_PLUGINS=1
it also shows that the library is being loaded:Even when running the application with
-style GTK
it still uses Fusion.Is there any way to make it use the native platform style?
The text was updated successfully, but these errors were encountered: