therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.51k stars 749 forks source link

Linux doesn't use widgets set by `qt5ct` #1049

Open codic12 opened 4 years ago

codic12 commented 4 years ago

Instead, it uses the Fusion style. I notice:

(first:22925): Gtk-WARNING **: 18:46:45.464: Theme parsing error: gtk.css:2:42: Expected ')' in color definition

(first:22925): Gtk-WARNING **: 18:46:45.466: Theme parsing error: gtk.css:5:21: Failed to import: Error opening file /home/codic/.config/gtk-3.0/colors.css: No such file or directory

shows in the log, but I don't want the GTK style applied; I want the QT Style (set to kvantum-dark) applied. Tried running with QT_STYLE_OVERRIDE=kvantum go run ../qt/first.go, got

QApplication: invalid style override passed, ignoring it.
    Available styles: Windows, Fusion

This is the LineEdit example but occurs on all examples using QtWidgets. QtQuick is different and isn't supposed to use the system style, so that's not a problem :) I'm on Ubuntu Budgie 19.10 with go version go1.13.6 linux/amd64

therecipe commented 4 years ago

Hey

You will need to setup the binding with QT_PKG_CONFIG=true to make QT_STYLE_OVERRIDE work: https://github.com/therecipe/qt/wiki/Installation-on-Linux#your-system-package-managers-version-without-android-support

More info about this issue here: https://github.com/therecipe/qt/wiki/Common-Issues#why-my-app-doesnt-look-native-in-linux-

codic12 commented 4 years ago

Your applications won't run on a different distro than the one you used to deploy your application, but this is currently the only option to make your application look native on your distro. More infos about this issue here: Why does my application don't look native on Linux?

Well then I'll keep this open until it's fixed :}