Could not parse stylesheet of widget
来源:互联网 发布:js验证密码的正则 编辑:程序博客网 时间:2024/04/29 01:13
今天想调试程序的时候一点窗口就弹出来一堆 Could not parse stylesheet of widget ,经过检查,不是QSS文件里的问题,也不是designer界面里样式表的问题,肯定是代码里 setStyleSheet 里出错了。果然如此。检查后发现是
ui.pushButtonVideo_1_1->setStyleSheet("border-style: inset; border-width: 4px; border-radius: 0px; border-color: yellow; color:rgba(0, 0, 0, 100); ");
双引号里面多了个 右花括号 } 去掉就OK啦!
在 designer 里写 stylesheet 会直接提示是否为有效样式表,我QSS文件里的样式表也是从designer 里拷进去的,这也印证了我的猜测。网上这哥们也遇到过这个问题。
如题
Could not parse stylesheet of widget 0x10f5a40Could not parse stylesheet of widget 0xcecf50
Could not parse stylesheet of widget 0x10b19b8
Could not parse stylesheet of widget 0x12444c0
Could not parse stylesheet of widget 0x114e320
Could not parse stylesheet of widget 0x1150158
代码:
this->setStyleSheet("font: 9pt;\nborder: 1px;\nborder-image:url(" + upGraph +");");
this->setStyleSheet("font: "+size+"pt;\nborder: 1px;\nborder-image:url(" + dnGraph +");\ncolor:"+forcolor+"}");
【this指的是QPushButton】
可是我程序是正常运行的 样式什么的也没什么问题 但调试就出现上面的提示错误 是怎么回事....
我找到啦 卜是换行符的原因 this->setStyleSheet("font: "+size+"pt;\nborder: 1px;\nborder-image:url(" + dnGraph +");\ncolor:"+forcolor+"}"); 这个里面size 、dnGraph、forcolor这三个变量 在为空的时候 就会出现Could not parse stylesheet of widget 这种情况 【QString aa=tr("font:%1pt;border: 1px;color:%2;border-image:url(%3);").arg(size).arg(forcolor).arg(dnGraph);
this->setStyleSheet(aa);】我这样写就卜会有那样的错误啦 呵呵.. 问题解决啦
0 0
- Could not parse stylesheet of widget
- Could not parse application stylesheet 这是什么原因
- hibernate Could not parse 问题
- Could not parse POM gradle
- javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
- Settings: Could not parse struts.locale setting...
- Could not parse configuration: /hibernate.cfg.xml
- Could not parse configuration /hibernate.cfg.xml
- Could not parse configuration: /hibernate.cfg.xml
- Could not parse configuration: /hibernate.cfg.xml
- PL/SQL Beautifier could not parse text
- springboot Could not parse multipart servlet request
- Could not initialize class android.widget.TextView
- Hibernate:Could not parse mapping document from invalid mapping Could not parse mapping document
- 处理 Could not parse relay log event entry
- Hibernate初始化时的Could not parse configuration
- Could not parse configuration: /hibernate.cfg.xml 异常
- org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
- sqlite入门基础(二):sqlite3_get_table,sqlite3_free_table
- linux TC命令使用总结
- 直接选择排序总结
- LPC1768@100MHz和LPC1788@120MHz的PLL0设置
- android gen 目录消失
- Could not parse stylesheet of widget
- Visual Studio原生开发的10个调试技巧
- 《Linux总线、设备与驱动》USBHID设备驱动
- Android Tombstone/Crash的log分析和定位
- Android JNI知识简介
- Android 如何在自己的应用中模拟Home键
- ReactiveCocoa
- makefile
- android 图片下载 类