Merge pull request #793 from FrancoisDuchene/notEnoughArgsFix

Fix for TypeErrors when using certain app styles
This commit is contained in:
Tobias Frisch 2021-04-08 14:46:59 +02:00 committed by GitHub
commit 2545f9c7a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -313,7 +313,7 @@ class outlineLabelDelegate(QStyledItemDelegate):
idx = self.mdlLabels.indexFromItem(item)
opt = QStyleOptionViewItem(option)
self.initStyleOption(opt, idx)
s = qApp.style().sizeFromContents(QStyle.CT_ItemViewItem, opt, QSize())
s = qApp.style().sizeFromContents(QStyle.CT_ItemViewItem, opt, QSize(), None)
if s.width() > 150:
s.setWidth(150)
elif s.width() < 50:

View file

@ -34,8 +34,8 @@ class treeTitleDelegate(QStyledItemDelegate):
opt = QStyleOptionViewItem(option)
self.initStyleOption(opt, index)
iconRect = style.subElementRect(style.SE_ItemViewItemDecoration, opt)
textRect = style.subElementRect(style.SE_ItemViewItemText, opt)
iconRect = style.subElementRect(style.SE_ItemViewItemDecoration, opt, None)
textRect = style.subElementRect(style.SE_ItemViewItemText, opt, None)
# Background
style.drawPrimitive(style.PE_PanelItemViewItem, opt, painter)