Results 1 to 3 of 3

Thread: Color QLCDNumber with style sheet

  1. #1
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Color QLCDNumber with style sheet

    Trying to color a QLCDNumber with a style sheet - not working.

    Here's what I tried:
    QLCDNumber::section{background-color::green}

    No effect.

    The rest of my style sheet works fine. This is the only problem.
    Has anyone done this before and knows what works?
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Color QLCDNumber with style sheet

    ::section is not a sub control of QLCDNumber (see docs)
    QLCDNumber is a QFrame subclass, so have a look at the StyleSheets reference for QFrame.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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

    waynew (15th April 2011)

  4. #3
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Color QLCDNumber with style sheet

    Thanks high_flyer - that explains why I couldn't find what I needed in the doc

Similar Threads

  1. QComboBox - style sheet set text color non focus?
    By alan in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2011, 00:31
  2. Problems with Gradient style used through Style sheet on ARM platform
    By puneet.narsapur in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th January 2010, 13:48
  3. qt 4 color palette / style sheet question
    By killerwookie99 in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2008, 00:05
  4. Style Sheet color of QComboBox
    By tpf80 in forum Qt Programming
    Replies: 6
    Last Post: 25th June 2007, 03:55
  5. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 14:05

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.