mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
86255b1b10
commit
306a2e206c
@ -342,6 +342,7 @@ class FontFamilyModel(QAbstractListModel):
|
||||
self.families = list(qt_families.intersection(set(self.families)))
|
||||
self.families.sort()
|
||||
self.families[:0] = [_('None')]
|
||||
self.font = QFont('sansserif')
|
||||
|
||||
def rowCount(self, *args):
|
||||
return len(self.families)
|
||||
@ -354,10 +355,11 @@ class FontFamilyModel(QAbstractListModel):
|
||||
return NONE
|
||||
if role == Qt.DisplayRole:
|
||||
return QVariant(family)
|
||||
if False and role == Qt.FontRole:
|
||||
# Causes a Qt crash with some fonts
|
||||
# so disabled.
|
||||
return QVariant(QFont(family))
|
||||
if role == Qt.FontRole:
|
||||
# If a user chooses some non standard font as the interface font,
|
||||
# rendering some font names causes Qt to crash, so return what is
|
||||
# hopefully a "safe" font
|
||||
return QVariant(self.font)
|
||||
return NONE
|
||||
|
||||
def index_of(self, family):
|
||||
|
Loading…
x
Reference in New Issue
Block a user