diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index 4a855f553a..9846d4d46d 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -143,7 +143,8 @@ class LocationDelegate(QAbstractItemDelegate): def paint(self, painter, option, index): style = QApplication.style() painter.save() - QApplication.style().drawControl(QStyle.CE_ItemViewItem, option, painter) + if hasattr(QStyle.CE_ItemViewItem): + QApplication.style().drawControl(QStyle.CE_ItemViewItem, option, painter) highlight = getattr(index.model(), 'highlight_row', -1) == index.row() mode = QIcon.Active if highlight else QIcon.Normal pixmap = QIcon(index.model().data(index, Qt.DecorationRole)).pixmap(self.pixmap.size())