还是Qt 通过stylesheet或者palette设置背景色的问题
2009-11-11 21:56
351 查看
关于Qt,设置一个widget的背景色后,希望子对象不受影响。 很久以前在QtForum上问过一个问题:http://www.qtforum.org/post/94103/setting-background-color-on-widgets-makes-child-widget-wrong-style.html?highlight=#post94103
在stackoverflow上也有类似的问题:http://stackoverflow.com/questions/177778/in-qt-how-do-i-set-the-background-color-of-a-widget-like-combobox-or-double-spin
现在的方法是:
1. 要是设置整个对话框的,就用palette
2. 要是设置某个对象的,就用selector
或者
在stackoverflow上也有类似的问题:http://stackoverflow.com/questions/177778/in-qt-how-do-i-set-the-background-color-of-a-widget-like-combobox-or-double-spin
现在的方法是:
1. 要是设置整个对话框的,就用palette
2. 要是设置某个对象的,就用selector
Class Selector | .QPushButton | Matches instances of QPushButton , but not of its subclasses. This is equivalent to *[class~="QPushButton"] . |
ID Selector | QPushButton#okButton | Matches all QPushButton instances whose object name is okButton . |
相关文章推荐
- 还是Qt 通过stylesheet或者palette设置背景色的问题
- ListView 通过 selector 设置背景色的问题
- QT QPushButton 通过stylesheet 设置样式
- QT QPushButton 通过stylesheet 设置样式
- QT在linux环境下读取和设置系统时间(通过system来直接调用Linux命令,注意权限问题)
- Qt 设置窗体QPalette 以及透明问题
- Qt 使用QPalette设置Qpushbutton背景色的问题
- Qt Qpushbutton设置背景色的问题
- QT 编译通过但是运行出现程序异常结束或者crashed的问题 在QT creator中最佳解决办法
- 【iOS遇到的问题】switch控件--在设置switch按钮状态为on或者off,运行app,模拟器黑屏
- js中input的属性设置问题(变量设置,字符串拼接,通过函数设置)
- 对于UITableViewStyleGrouped类型的UITableView的背景色设置问题
- Qt给窗口或者控件设置透明度
- IOS UIview设置背景图片以及设置背景色遇到的问题
- ios 解决第一个页面是通过loadData或者是loadHtml时返回控制的问题
- 对QPushbutton背景设置palette无法生效的问题
- Android framework中修改或者添加资源无变化或编译不通过问题详解
- ViewPager为相邻页面设置间距并配置背景色出现白色细线问题的解决方案
- 不能在此路径中使用此配置节。如果在父级别上锁定了该节,便会出现这种情况。锁定是默认设置的(overrideModeDefault="Deny"),或者是通过包含 overrideMode="Deny"
- RecyclerView 复用出现 CheckBox 或者 设置背景混乱问题