Display bug corrected in outline view

This commit is contained in:
Olivier Keshavjee 2016-03-24 11:37:18 +01:00
parent d4268813f6
commit 9f0c5fe527
2 changed files with 8 additions and 2 deletions

View file

@ -42,6 +42,12 @@ class characterModel(QAbstractItemModel):
else:
return ""
elif role == Qt.DecorationRole:
if index.column() == C.name.value:
return c.icon
else:
return QVariant()
elif type(c) == CharacterInfo:
if role == Qt.DisplayRole or role == Qt.EditRole:
if index.column() == 0:

View file

@ -278,7 +278,7 @@ class outlineStatusDelegate(QStyledItemDelegate):
def paint(self, painter, option, index):
QStyledItemDelegate.paint(self, painter, option, index)
if index.isValid() and index.internalPointer().data(Outline.status.value) not in ["", None, "0"]:
if index.isValid() and index.internalPointer().data(Outline.status.value) not in ["", None, "0", 0]:
opt = QStyleOptionComboBox()
opt.rect = option.rect
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow)
@ -344,7 +344,7 @@ class outlineLabelDelegate(QStyledItemDelegate):
qApp.style().drawControl(QStyle.CE_ItemViewItem, opt, painter)
# Drop down indicator
if index.isValid() and index.internalPointer().data(Outline.label.value) not in ["", None, "0"]:
if index.isValid() and index.internalPointer().data(Outline.label.value) not in ["", None, "0", 0]:
opt = QStyleOptionComboBox()
opt.rect = option.rect
r = qApp.style().subControlRect(QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxArrow)