mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Check for color valid when using column coloring
This commit is contained in:
parent
0bd580f572
commit
29b453ba23
@ -726,7 +726,9 @@ class BooksModel(QAbstractTableModel): # {{{
|
||||
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…
x
Reference in New Issue
Block a user