Results 1 to 4 of 4

Thread: Style sheet and QStyle cohabitation

  1. #1
    Join Date
    Jan 2006
    Location
    La Spezia,Italy
    Posts
    77
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Style sheet and QStyle cohabitation

    Hello everybody, it may be that I'm raising an old problem but I haven't found any solution or whatever.

    I'm using a subclass of QStyle in my application and I'm trying to do minor customization with a stylesheet.
    The problem is that when I apply a stylesheet (even an extremely reduced one as you will see) to my application, the old colors of the style get screwed.
    In particular, I have defined a sublcass of QLabel named StyLabel to which I set a Q_PROPERTY named lType. Then, If I apply a style sheet like:
    Qt Code:
    1. StyLabel[lType="value"] { color: red}
    To copy to clipboard, switch view to plain text mode 
    the colors of the other QLabel, that uses a color different from QPalette::text, get screwed. Is this the unavoidable consequence of applying stylesheets or what?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Style sheet and QStyle cohabitation

    Quote Originally Posted by vratojr View Post
    Hello everybody, it may be that I'm raising an old problem but I haven't found any solution or whatever.
    Well, from the docs:
    Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.
    (you find that on the page "Qt Style Sheets")

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

    vratojr (24th September 2010)

  4. #3
    Join Date
    Jan 2006
    Location
    La Spezia,Italy
    Posts
    77
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Style sheet and QStyle cohabitation

    Doh, I don't know how many times I went through that page... Thank you for pointing out what was painfully obvious!

  5. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Style sheet and QStyle cohabitation

    Quote Originally Posted by vratojr View Post
    Doh, I don't know how many times I went through that page...
    Yeah, that happens. You specially skip things you don't want to see

Similar Threads

  1. 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, 12:48
  2. Style Sheet Problem
    By zgulser in forum Qt Tools
    Replies: 8
    Last Post: 17th February 2009, 08:27
  3. Difference between QStyle and Style Sheet
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2008, 09:55
  4. Style Sheet speed
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2008, 18:40
  5. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 13: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.