QLabel (富文本方式) QString 字符串设置不同字体、大小、颜色等
作者:互联网
QSize nSize(300,25);
m_pStatic = new QLabel((QWidget*)GetUIWnd());
m_pStatic->resize(nSize);
QString strText = QString::fromStdWString(_CS(L"<font style = 'font-size:14px; font-weight:bold'>You Can See it from this: </font> <font style = 'color:#2C5DFF; font-size:14px; font-weight:bold'> %1 </font> <font style = 'font-size:14px; font-weight:bold'>example.</font>")).arg(0);
m_pStatic->setText(strText);
标签:QSize,pStatic,strText,nSize,QString,文本,QLabel 来源: https://blog.csdn.net/qq_33591755/article/details/120365868