From 238f9391ea57423931fc64935c20deea1ff0f11c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 27 Oct 2010 15:25:58 -0600 Subject: [PATCH] Fix #6895 (calibre crashes after preferences/conversion/output_modules is clicked) --- src/calibre/gui2/widgets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index 60224aefc7..12d64bbbcd 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -16,7 +16,7 @@ from PyQt4.Qt import QIcon, QFont, QLabel, QListWidget, QAction, \ QTimer, QRect from calibre.gui2 import NONE, error_dialog, pixmap_to_data, gprefs - +from calibre.constants import isosx from calibre.gui2.filename_pattern_ui import Ui_Form from calibre import fit_image from calibre.utils.fonts import fontconfig @@ -303,7 +303,8 @@ class FontFamilyModel(QAbstractListModel): return NONE if role == Qt.DisplayRole: return QVariant(family) - if role == Qt.FontRole: + if not isosx and role == Qt.FontRole: + # Causes a Qt crash with some fonts on OS X return QVariant(QFont(family)) return NONE