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())
|
txt = unicode(index.data(Qt.DisplayRole).toString())
|
||||||
if len(colors) > 0 and txt in values:
|
if len(colors) > 0 and txt in values:
|
||||||
try:
|
try:
|
||||||
return QColor(colors[values.index(txt)])
|
color = colors[values.index(txt)]
|
||||||
|
if QColor.isValid(color):
|
||||||
|
return QColor(color)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user