Results 1 to 2 of 2

Thread: Problem mit Stylesheets

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Problem mit Stylesheets

    Hi, I have a problem with stylesheets when applied to QLabels. The background-attribute is simply ignored. But when I swiftly resize the widget with the mousecurser, I can see traces of its background-color at the edge of the Window.

    Thanx in advance
    momesana

    Qt Code:
    1. #include<QApplication>
    2. #include <QtGui>
    3.  
    4. int main( int argc, char ** argv)
    5. {
    6. QApplication app( argc, argv);
    7. QLabel * label = new QLabel(mw);
    8. label->setText("Where is my color??? :'(");
    9. label->setStyleSheet( "background-color:yellow; text-align:center; color:blue;" );
    10. mw->setCentralWidget(label);
    11. mw->show();
    12. return app.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problem mit Stylesheets

    Seems you have to:
    Qt Code:
    1. label->setAutoFillBackground(true);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    momesana (10th November 2006)

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 13:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 13:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 15:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.