Results 1 to 6 of 6

Thread: Stylesheets & QPushButton menus

  1. #1
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Stylesheets & QPushButton menus

    Hi, I need to change the style of a QPushButton menu. I've already tried these statements without success:

    Qt Code:
    1. /* ... */
    2. }
    3.  
    4. /* ... */
    5. }
    To copy to clipboard, switch view to plain text mode 

    So how can I create a custom style for QPushButton menus?

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Stylesheets & QPushButton menus

    Quote Originally Posted by zuck View Post
    Hi, I need to change the style of a QPushButton menu.
    This is not documented in Qt style sheet sub controls list but you can give it a try because your try has a significant mistake.
    Try this:
    Qt Code:
    1. /* DO SOME STYLING */
    2. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Stylesheets & QPushButton menus

    It doesn't work

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Stylesheets & QPushButton menus

    Ok !, This is clear now, you just style the QMenu and QPushbuttdon's menu will also styled.
    QMenu{
    //Do Some Styling
    }

  5. #5
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Stylesheets & QPushButton menus

    Unfortunately, I've already tried this and it doesn't work too...

  6. #6
    Join Date
    Nov 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Stylesheets & QPushButton menus

    Hello,

    I have the same problem...
    The QMenu's style doesn't work with the QPushButton's menu...

    Have you got one idea??

    Sorry for my poor english, it's not my mother tongue.

    Antony

Similar Threads

  1. Adding QPushButton to *.ui file by hand
    By s410i in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2009, 13:08
  2. Qpushbutton
    By iamhere in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2008, 04:40
  3. QPushButton, stylesheets, text alignment
    By SiLiZiUMM in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2007, 19:53
  4. Maya Style Right Click Menus in Qt
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2007, 11:55
  5. Replies: 3
    Last Post: 26th September 2006, 12:16

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.