nameList = ('John','Tom','Henry','Michelle','Ashish','Jo-Huang', ...)
colorNameList = ('Michelle','Jennifer','Claudia','JimSung', ...)
callBackObj.NameComboBox.clear()
callBackObj.
NameComboBox.
addItem(QString('Account Names'))model = callBackObj.NameComboBox.model()
for name in nameList:
if name in colorNameList:
item.
setBackground(PyQt4.
QtGui.
QColor('red')) model.appedRow(item)
nameList = ('John','Tom','Henry','Michelle','Ashish','Jo-Huang', ...)
colorNameList = ('Michelle','Jennifer','Claudia','JimSung', ...)
callBackObj.NameComboBox.clear()
callBackObj.NameComboBox.addItem(QString('Account Names'))
model = callBackObj.NameComboBox.model()
for name in nameList:
item = PyQt4.QtGui.QStandardItem(str(account))
if name in colorNameList:
item.setBackground(PyQt4.QtGui.QColor('red'))
model.appedRow(item)
To copy to clipboard, switch view to plain text mode
Bookmarks