mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Fix for TypeErrors when using certain styles
When i was using certain styles like cleanlooks or qt5ct-style, a TypeError was raising in cascade about the function not having enough arguments. It looked like that, despite the last args of Qstyle.subElementRect() and Qstyle.sizeFromContents() were optional, it was still required to mention it (even if it was just None). That TypeError was only appearing with certain styles, at startup or when changing styles in the settings window.
This commit is contained in:
parent
917f1a2f73
commit
bd7b1e96f7
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue