Results 1 to 2 of 2

Thread: qCheckbox back ground color

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 6 Times in 5 Posts

    Default Re: qCheckbox back ground color

    The QPalette::Base role is responsible for the color of the box.

    The following snippet would set it do blue.
    Qt Code:
    1. QCheckBox cb ( "A CheckBox" );
    2.  
    3. QPalette p = cb.palette( );
    4. QColor blue( 0, 0, 255 );
    5. p.setColor( QPalette::Active, QPalette::Base, blue );
    6. cb.setPalette( p );
    To copy to clipboard, switch view to plain text mode 

    See
    http://doc.trolltech.com/4.2/qpalett...ColorRole-enum
    This also should solve your QComboBox problem.

  2. The following user says thank you to ggrinder for this useful post:

    sreedhar (21st December 2006)

Similar Threads

  1. qcombobox back ground coloring
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2006, 20:29
  2. problem with the back ground image
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2006, 22:34

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
  •  
Qt is a trademark of The Qt Company.