这是我的示例代码,如何更改QComboBox的文本颜色。在此代码中,我的内部文本没有白色。请指导我。 鉴于下面是我的代码:
import sys
from PySide import QtGui, QtCore
class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
self.initUI()
def initUI(self):
self.vbox = QtGui.QVBoxLayout()
self.cb = QtGui.QComboBox()
self.cb.addItems(["100", "200","400","600","900", "700","1000","1200"])
self.cb.setStyleSheet("QComboBox { border: 2px solid white;color:white } QFrame { border: 2px solid white; }")
self.vbox.addWidget(self.cb)
self.setLayout(self.vbox)
self.setStyleSheet("QWidget {background-color:black;color:white}")
self.setGeometry(300, 300, 355, 280)
self.show()
def main():
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
if __name__ == '__main__':
main()