QString txtStyle = "我的测试<span style='background:%1;'>%2</span><font style='font-size:16px; background-color:yellow; color:blue;'>test txt</font>";
QString color="rgb(250, 48, 48)";
QString txt="文字";
QString strLog = txtStyle.arg(color).arg(txt);
ui->label->setText(strLog);
如何设置QString字符串不同颜色
于 2024-01-15 14:48:35 首次发布