Search code examples
pythonlinuxpyqt4rhelqicon

Why don't my QIcons show in my QMenu when I run my PyQt application as root?


I have a PyQt4 application I am working on and I have an issue that I can't seem to solve. I have a bunch of QActions that have a valid QIcon set. These QActions are on a QToolBar, as well as a QMenu. The QIcons show on the QToolBar and the QMenu just fine when run as a normal user, but if I run the application with sudo or when logged in as root, the QIcons show on the QToolBar, but not in the QMenu. I am running this on RHEL 6.7 and have checked permissions of all my files. Any idea what might be happening?


Solution

  • I just found that showing icons in menus for root was turned off. I needed to run the command below to get them to work.

    gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true