// 获取当前日期
QDateTime currentDateTime = QDateTime::currentDateTime();
QString currentDateStr = currentDateTime.toString("[yyyy.MM.dd hh:mm:ss ddd] ");
// 设置文字(样式+内容)
QString str= "<font color=\"#FF0000\">" + currentDateStr + "信息"+ "</font>";
ui.textBrowser->append(str);