PDA

View Full Version : How to change text color of push button?



augusbas
3rd July 2009, 09:01
Hi ,

i need to change the PushButton Text Color to White . Please Help me .

I had done Push Button as transparent so i need to change the color

gsmiko
3rd July 2009, 09:13
Hi!

Just change the buttons stylesheet or it's parents stylesheet if you want to change the foreground color of multiple buttons.

In the 1st case:

color:white;

2nd case:

QPushButton
{
color:white;
}

genessr
3rd July 2009, 10:32
Hi ,

i need to change the PushButton Text Color to White . Please Help me .

I had done Push Button as transparent so i need to change the color

Hello my friend try this in your program, I've tested it on my project it worked rgb(255, 0, 0) stands for red background color and rgb(255, 255, 255) for white text color.

m_ui->pushButton_filter->setAutoFillBackground(true);
m_ui->pushButton_filter->setStyleSheet("background-color: rgb(255, 0, 0); color: rgb(255, 255, 255)");