qlabel set text color 1

qlabel set text color

ui->labelName->setStyleSheet("color: #FF0000");

Here is what the above code is Doing:
1. We’re creating a QPalette object.
2. We’re setting the background color of the palette to white.
3. We’re setting the text color of the palette to red.
4. We’re setting the palette of the label to the palette we created.

Similar Posts