How to create a bold, red text label in Qt?

前端 未结 4 2068
甜味超标
甜味超标 2020-12-29 02:01

I want to write a single, bold red line in my application using Qt.

As far as I understand, I would create a QLabel, set its textFormat to rich text and give it a ri

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 02:28

    You can also do it programmatically using the settext function. Something like this:

    QString labelText = "

    "; labelText .append("Text what u want to display"); labelText .append("


    "); QLabel label->setText(labelText);

    You can do it in a single line as well.

提交回复
热议问题