Results 1 to 16 of 16

Thread: Backgound color of QWidget

Threaded View

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

    Default Re: Backgound color of QWidget

    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3. #include <QPalette>
    4.  
    5. int main( int argc, char **argv )
    6. {
    7. QApplication app( argc, argv );
    8.  
    9. QLabel l;
    10. QPalette p( l.palette() );
    11. p.setColor( QPalette::Window, Qt::darkCyan );
    12. l.setPalette( p );
    13.  
    14. l.show();
    15.  
    16. return app.exec();
    17. }
    To copy to clipboard, switch view to plain text mode 
    I use Qt 4.1.1 under PLD Linux.
    Attached Images Attached Images

Similar Threads

  1. Replies: 0
    Last Post: 11th November 2008, 15:36
  2. Dynamic updates of a QWidget in a QScrollArea
    By plamkata in forum Qt Programming
    Replies: 2
    Last Post: 20th July 2008, 23:45
  3. Error in put one QWidget in another QWidget
    By xjtu in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2008, 16: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
  •  
Qt is a trademark of The Qt Company.