Results 1 to 4 of 4

Thread: Qt Style Sheets Problems with QDialog

  1. #1
    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 Qt Style Sheets Problems with QDialog

    Hi,

    in my application-wide css i define
    Qt Code:
    1. * {color: #333333;}
    2. QPushButton[enabled="false"] {color: FF0000;}
    To copy to clipboard, switch view to plain text mode 
    This works in my "normal" Application. But if i start a normal QDialog-Subclass via
    Qt Code:
    1. dgl_xyz dgl( this, Qt::Dialog );
    2. dgl.setAttribute( Qt::WA_ShowModal );
    3. if ( dgl.exec() == QDialog::Accepted )
    4. {
    5. //...
    6. }
    To copy to clipboard, switch view to plain text mode 
    the fonts color is #333333, but the font of the disabled QPushButtons are also gray instead of red.


    What's wrong?


    Thanks,

    Lykurg

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Style Sheets Problems with QDialog

    How about:
    CSS Code:
    1. QPushButton:enabled {color: FF0000;}
    To copy to clipboard, switch view to plain text mode 
    ?

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

    Lykurg (5th November 2006)

  4. #3
    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: Qt Style Sheets Problems with QDialog

    works! So I learnd
    css Code:
    1. QPushButton:disabled != QPushButton[enabled="false"]
    To copy to clipboard, switch view to plain text mode 
    in every case.

    Thanks

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Style Sheets Problems with QDialog

    Quote Originally Posted by Lykurg View Post
    works! So I learnd
    css Code:
    1. QPushButton:disabled != QPushButton[enabled="false"]
    To copy to clipboard, switch view to plain text mode 
    in every case.
    That's probably because of this:
    Warning: If the value of the property changes after the style sheet has been set, it might be necessary to force a style sheet recomputation. One way to achieve this is to unset the style sheet and set it again.

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.