mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 01:03:26 +02:00
Check for color valid when using column coloring
This commit is contained in:
parent
0bd580f572
commit
29b453ba23
1 changed files with 3 additions and 1 deletions
|
|
@ -726,7 +726,9 @@ def data(self, index, role):
|
|||
txt = unicode(index.data(Qt.DisplayRole).toString())
|
||||
if len(colors) > 0 and txt in values:
|
||||
try:
|
||||
return QColor(colors[values.index(txt)])
|
||||
color = colors[values.index(txt)]
|
||||
if QColor.isValid(color):
|
||||
return QColor(color)
|
||||
except:
|
||||
pass
|
||||
return None
|
||||
|
|
|
|||
Loading…
Reference in a new issue