我正在使用PyQt5及其编辑器制作pythongui。试着给我用样式表玩的东西加些颜色。但我在QMainQindow(图像的左侧和QDialog(右侧[期望的外观])中使用它时遇到了不同的结果。就像它对其他小部件都产生了同样的效果。在
[![在此处输入图像说明][1]][1]
QMainWindow中的代码
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<property name="styleSheet">
<string notr="true">QWidget{
background-color:qlineargradient(spread:repeat, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(39, 21, 103, 255), stop:1 rgba(94, 94, 140, 255))
}
QPushButton{
background-color: qlineargradient(spread:pad, x1:0.915, y1:0.227273, x2:1, y2:0, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(56, 56, 140, 255));
font: 75 8.5pt "Sitka Small";
}
QToolButton{background-color: qlineargradient(spread:pad, x1:0.915, y1:0.227273, x2:1, y2:0, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(56, 56, 140, 255));
font: 75 8.5pt "Sitka Small";
}
QLabel{
color: rgb(255, 255, 255);
}
font: 75 8.5pt "Sitka Small"
</string>
</property>
来自QDialog的代码
^{pr2}$我怎样才能看到QMainWindow右边的QDialog?在
我找到了this QA。而且Qt5 StyleSheet syndax page似乎证实了这一点
并将QMainWindow中的其余代码保持不变。在
相关问题 更多 >
编程相关推荐