Trouble setting toolbar widget palette
Hello!
My program has a mainwindow with a number of toolbars. I want to add a toolbar that contains a QLabel displaying some text and would like the text to be, let's say, red.
What i'm doing:
Code:
MyWindow::MyWindow()
{
label->setPalette(palette);
label->setText("wo0t");
tb->addWidget(label);
this->addToolBar(QT::TopToolBarArea, tb);
}
What i'm expecting: the toolbar text to be red.
What i'm getting: the toolbar text is not changing, at all.
Any thoughts? What am I doing wrong? Should I maybe set the text and the palette after construction has finished?
Re: Trouble setting toolbar widget palette
Further testing reveals that the problem is confined to certain window styles, ex: CDE, Motif and Cleanlooks.
Also, setting the palette of a label anywhere that isn't in a toolbar seems to work ok, regardless of the style.
Should this behavior be considered a bug or a feature?