Ask Your Question
3

Qt applicaitons not using GTK+ theme

asked 2016-06-30 13:36:10 -0500

Gerharddc gravatar image

I am on an up to date Fedora 24 GNOME system and all my Qt applicaiton (Qt Creator, VirtualBox etc...) are not using my GTK+ theme (any theme) and instead falling back to something seriously ugly. I tried to use qt5ct but it crashes when I choose GTK+. I also get this crash when I try to run qtcreator with the -style=gtk flag:

(qtcreator:11940): GLib-GObject-WARNING **: cannot register existing type 'GdkDisplayManager'

(qtcreator:11940): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(qtcreator:11940): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

(qtcreator:11940): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(qtcreator:11940): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(qtcreator:11940): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(qtcreator:11940): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(qtcreator:11940): GLib-GObject-WARNING **: cannot register existing type 'GdkDisplay'

(qtcreator:11940): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(qtcreator:11940): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed

(qtcreator:11940): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(qtcreator:11940): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

Running virtualbox with the flag does not cause a crash though and it then looks correct. Also, no matter what I do I also cannot get Qt application to use my GTK+ icons.

What can I do to fix this?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-07-21 16:03:24 -0500

removing qgnomeplatform does the trick

dnf remove qgnomeplatform
edit flag offensive delete link more
0

answered 2016-07-05 01:16:41 -0500

knesset gravatar image

updated 2016-07-05 01:27:24 -0500

Hi! I'm not really understand how it works, its something about environment variable QT_QPA_PLATFORMTHEME which is set to qgnomeplatform by default. You need to set it to gtk. I created a file /etc/profile.d/zz-qt.sh to set env variable with one line inside:

export QT_QPA_PLATFORMTHEME=gtk

After relogin it works, but only if I run kdenlive (qt5-app) from terminal. I tried different variants to set it (~/.pam_environment, ~/.bashrc, ~/.profile, even creating conf file in /etc/systemd/user.conf.d/) but none of this worked, I dont know why. Finally I changed one line .desktop file at /usr/share/applications to

Exec=env QT_QPA_PLATFORMTHEME=gtk kdenlive %U

Now It runs fine from gnome-shell too. But I guess I'll have to change it every time after updating kdenlive.

Kdenlive allows to change style in menu. So, in case you using other apps, you also might need to set env var QT_STYLE_OVERRIDE=gtk.

And, please, let me know if you'll figure out how to correctly set env var to work with gnome-shell shortcuts.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-06-30 13:36:10 -0500

Seen: 3,739 times

Last updated: Jul 05 '16