Results 1 to 3 of 3

Thread: Stylesheet Universal Selector exclude widgets

  1. #1
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Stylesheet Universal Selector exclude widgets

    I have a simple stylesheet in Designer for a QMainwindow
    Qt Code:
    1. * { font-family:"System"; font-size: 12pt; }
    To copy to clipboard, switch view to plain text mode 
    I would like exclude QMenuBar from inheriting that font.
    Qt Code:
    1. QMenuBar {} /* set to default, doesn't work */
    To copy to clipboard, switch view to plain text mode 
    Any suggestions?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Stylesheet Universal Selector exclude widgets

    There is no way to reapply the default value, you can only apply a particular value. So, set a particular value for QMenuBar or set the global style only on the central widget rather than the QMainWindow instance.

  3. The following user says thank you to ChrisW67 for this useful post:

    Henry Blue Heeler (27th March 2016)

  4. #3
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Stylesheet Universal Selector exclude widgets

    Quote Originally Posted by ChrisW67 View Post
    set the global style only on the central widget rather than the QMainWindow instance.
    How could I be so dense? SMH. Thanks.

Similar Threads

  1. Replies: 5
    Last Post: 10th October 2012, 21:05
  2. Replies: 3
    Last Post: 17th November 2010, 12:50
  3. Can I layout widgets by using StyleSheet?
    By MorrisLiang in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2010, 12:20
  4. is universal Qt possible for win ?
    By eric in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 21:46
  5. QLabel Stylesheet selector issue.
    By Enygma in forum Qt Programming
    Replies: 3
    Last Post: 24th August 2007, 14:52

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.