PDA

View Full Version : How to install text color of an QLabel?



tumanovalex
24th September 2010, 12:02
On the standard form there is an QLabel with the text, would like to make at form loading text color of an the QLabel red, and after a file choice - green. Has tried:


QPalette t_palette = ui->lbFileName->palette();
t_palette.setColor(QPalette::Text, Qt::gray);
ui->lbFileName->setPalette(t_palette);

Color doesn't change. Prompt, please, as it to make.

Lykurg
24th September 2010, 12:24
Use QPalette::WindowText.

tumanovalex
24th September 2010, 12:41
Thanks big, all have turned out.