Results 1 to 1 of 1

Thread: Problems when styling QMenu with Qt Stylesheet

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Problems when styling QMenu with Qt Stylesheet

    Hi @all,

    How can I use the default checkboxes in a styled QMenu?
    I saw the following in the docmentation

    css Code:
    1. QMenu::indicator:non-exclusive:unchecked {
    2. image: url(:/images/checkbox_unchecked.png);
    3. }
    4.  
    5. QMenu::indicator:non-exclusive:unchecked:selected {
    6. image: url(:/images/checkbox_unchecked_hover.png);
    7. }
    8.  
    9. QMenu::indicator:non-exclusive:checked {
    10. image: url(:/images/checkbox_checked.png);
    11. }
    12.  
    13. QMenu::indicator:non-exclusive:checked:selected {
    14. image: url(:/images/checkbox_checked_hover.png);
    15. }
    To copy to clipboard, switch view to plain text mode 

    If I doesn't add these lines and I have an QActionGroup defined, then the checked elements have a gray background.

    :Edit: The problem only occurs if an icon is set for the menu item.

    Best Regards
    NoRulez
    Last edited by Lykurg; 14th May 2011 at 17:12. Reason: qss code to css code

Similar Threads

  1. Styling QComoBox using CSS Stylesheet
    By bjoernbg in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2010, 23:12
  2. Styling the tear-off handle of a QMenu?
    By dictoon in forum Qt Programming
    Replies: 2
    Last Post: 5th August 2010, 16:58
  3. Problem styling QComBox using stylesheet
    By sjagtap in forum Newbie
    Replies: 4
    Last Post: 22nd March 2010, 13:18
  4. QMenu::Scroller StyleSheet
    By AmolShinde_8 in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2010, 08:46
  5. Help with QMenu item stylesheet
    By Sufu in forum Qt Programming
    Replies: 11
    Last Post: 9th May 2009, 06:58

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.