假设当前名为Workspace的窗口上,水平布局了两个面板PanelLeft和PanelRight。通常情况下,设置Workspace的背景色,PanelLeft和PanelRight会继承这一属性。
在使用外部样式文件的情况下,如果不希望发生这种继承关系,可以这样处理:
第一步:在外部QSS文件中设置Workspace的背景色
#Workspace {
background - color: gainsboro;
}
第二步:在代码中设置PanelLeft和PanelRight的背景填充属性
PanelLeft->setAutoFillBackground(true);
PanelRight->setAutoFillBackground(true);
1183

被折叠的 条评论
为什么被折叠?



