Results 1 to 5 of 5

Thread: Icon in a QMenu doesn't show up on Linux

  1. #1
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Icon in a QMenu doesn't show up on Linux

    It would seem that menus on Linux don't display icons by default, if not at all. For one, and as mentioned here, there is the iconVisibleInMenu property for QAction which is, now, set to true by default. However, on Linux, it still doesn't work, unless you 'manually' set the property to false and then back to true (i.e. unlike in the default case, your .ui file will now include the fact that the property is set to true). So, that was one issue that I came across quite some time ago, but another which I hadn't noticed until yesterday is the icon associated to a QMenu. As mentioned here, the icon shows on Windows, but not on Linux. So, I was wondering whether someone had found a way around this problem, or do I have to wait for this bug to be fixed by the Qt guys?

  2. #2
    Join Date
    Mar 2010
    Location
    ua
    Posts
    4
    Thanks
    2
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Icon in a QMenu doesn't show up on Linux

    i guess you are using gnome (ubuntu)? menu icons are off, by default. here are some explanations, maybe your problem is not binded with Qt

  3. The following 2 users say thank you to rain87 for this useful post:

    agarny (2nd February 2011), phanyx (25th February 2011)

  4. #3
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Icon in a QMenu doesn't show up on Linux

    Brilliant, thanks a lot for this link. I was definitely not aware of that 'feature' on Ubuntu (which I indeed use, not because I like it but nevermind! ). Anyway, I have entered:

    Qt Code:
    1. $ gconftool-2 --type Boolean --set /desktop/gnome/interface/menus_have_icons True
    To copy to clipboard, switch view to plain text mode 
    and everything is now fine. Woo hoo!

  5. #4
    Join Date
    Mar 2010
    Location
    ua
    Posts
    4
    Thanks
    2
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Icon in a QMenu doesn't show up on Linux

    yes, pretty strange feature i don't understand, why is it turned on by default

  6. #5
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Icon in a QMenu doesn't show up on Linux

    Quote Originally Posted by rain87 View Post
    yes, pretty strange feature i don't understand, why is it turned on by default
    I guess you meant off... Whatever the case, thanks for your help on this matter, much appreciated!

Similar Threads

  1. Why QAction inside Qmenu doesn't display Icon ?
    By jpujolf in forum Qt Programming
    Replies: 8
    Last Post: 21st December 2009, 12:51
  2. Hide and Show QMenu
    By febil in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2009, 09:31
  3. QRubberBand doesn't show (X11/Linux)
    By QwertyManiac in forum Qt Programming
    Replies: 2
    Last Post: 29th October 2008, 22:58
  4. How to change Icon size in QMenu?
    By alex chpenst in forum Qt Programming
    Replies: 4
    Last Post: 3rd September 2008, 14:16
  5. QSystemTrayIcon doesn't show icon ?
    By probine in forum Qt Programming
    Replies: 3
    Last Post: 25th January 2007, 19:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.