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 = list(qt_families.intersection(set(self.families)))
|
||||||
self.families.sort()
|
self.families.sort()
|
||||||
self.families[:0] = [_('None')]
|
self.families[:0] = [_('None')]
|
||||||
|
self.font = QFont('sansserif')
|
||||||
|
|
||||||
def rowCount(self, *args):
|
def rowCount(self, *args):
|
||||||
return len(self.families)
|
return len(self.families)
|
||||||
@ -354,10 +355,11 @@ class FontFamilyModel(QAbstractListModel):
|
|||||||
return NONE
|
return NONE
|
||||||
if role == Qt.DisplayRole:
|
if role == Qt.DisplayRole:
|
||||||
return QVariant(family)
|
return QVariant(family)
|
||||||
if False and role == Qt.FontRole:
|
if role == Qt.FontRole:
|
||||||
# Causes a Qt crash with some fonts
|
# If a user chooses some non standard font as the interface font,
|
||||||
# so disabled.
|
# rendering some font names causes Qt to crash, so return what is
|
||||||
return QVariant(QFont(family))
|
# hopefully a "safe" font
|
||||||
|
return QVariant(self.font)
|
||||||
return NONE
|
return NONE
|
||||||
|
|
||||||
def index_of(self, family):
|
def index_of(self, family):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user