当前位置: 代码迷 >> 综合 >> 报错“Could not parse stylesheet of object 0x14e70758“
  详细解决方案

报错“Could not parse stylesheet of object 0x14e70758“

热度:29   发布时间:2023-10-15 23:50:54.0

 

 

出现问题 

报错代码:

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 微软雅黑;}");

 

 

  相关解决方案