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
#include<QApplication>
#include <QtGui>
int main( int argc, char ** argv)
{
label->setText("Where is my color??? :'(");
label->setStyleSheet( "background-color:yellow; text-align:center; color:blue;" );
mw->setCentralWidget(label);
mw->show();
return app.exec();
}
#include<QApplication>
#include <QtGui>
int main( int argc, char ** argv)
{
QApplication app( argc, argv);
QMainWindow * mw = new QMainWindow;
QLabel * label = new QLabel(mw);
label->setText("Where is my color??? :'(");
label->setStyleSheet( "background-color:yellow; text-align:center; color:blue;" );
mw->setCentralWidget(label);
mw->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks