How to create a bold, red text label in Qt?
You can use Qt StyleSheets and set the styleSheet
property of QLabel
warning->setStyleSheet("font-weight: bold; color: red");
Qt supports most CSS styles on its QWidget
-derived classes. You don't need to set the text format to Qt::RichText
for this to work.
Try using HTML formatting: <b><font... etc </b>
.
Qt Designer does it like this: <span style=" font-size:8pt; font-weight:600; color:#aa0000;">TextLabel</span>