Qt-Could not parse stylesheet of object 0x14e70758"

相关资料:

https://blog.csdn.net/mars_xiaolei/article/details/85111948

 

出现问题
报错代码:

ui->labelExperStatus->setStyleSheet("{color: black;font: 9pt 微软雅黑;}");
“Could not parse stylesheet of object 0x14e70758”

意思是:不能解析对象0x14e70758处的样式表


问题原因
使用样式表美化Qt控件时,语法错误,缺少控件类名


解决方法
ui->labelExperStatus->setStyleSheet("{color: black;font: 9pt 微软雅黑;}");
修改为:

ui->labelExperStatus->setStyleSheet("QLabel{color: black;font: 9pt 微软雅黑;}");

posted on 2021-09-13 18:29  疯狂delphi  阅读(1082)  评论(0编辑  收藏  举报

导航