Qt Designer中可以设置QLabel的字体颜色,我看了一下生成的ui文件里,是这么写的
destination_label->setText(QApplication::translate("guide_setclass", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'\345\256\213\344\275\223'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#ffffff;\">Set as destination</span></p></body></html>", 0, QApplication::UnicodeUTF8));
这个也太复杂了,我需要在我的程序里不定时的改变QLabel的颜色,哪位能给我解释下上面这段代码吗?我的意思是,用最短的语句实现改变Label的字体颜色。谢谢!