Skip to content

Commit

Permalink
Fix more even more crashes with newer QT versions
Browse files Browse the repository at this point in the history
This time I actually went through the docs and found all the elements in
`qproxystyle` that didn't have a default value for the widget, which are

```
sizeFromContents
subControlRect
subElementRect
```

and then went through the entire Manuskript project with grep and made
sure I didn't leave any more places that needed this change.

I confirmed that I would also crash in the full screen editor -- I'm not
sure how to get to the collapsibleGroupBox code within Manuskript
itself, but from looking at the code, it's almost definitely the same
issue.
  • Loading branch information
ByteOfBrie committed Aug 13, 2024
1 parent 57d7a78 commit 5d4aefd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions manuskript/ui/collapsibleGroupBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def paintEvent(self, event):
groupBox = opt

# // Draw frame
textRect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxLabel)
checkBoxRect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxCheckBox)
textRect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxLabel, None)
checkBoxRect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxCheckBox, None)

p.save()
titleRect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxFrame)
# r.setBottom(style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxContents).top())
titleRect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxFrame, None)
# r.setBottom(style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxContents).top(), None)
titleRect.setHeight(textRect.height())
titleRect.moveTop(textRect.top())

Expand All @@ -72,7 +72,7 @@ def paintEvent(self, event):
frame.features = groupBox.features
frame.lineWidth = groupBox.lineWidth
frame.midLineWidth = groupBox.midLineWidth
frame.rect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxFrame)
frame.rect = style.subControlRect(style.CC_GroupBox, opt, style.SC_GroupBoxFrame, None)
p.save()
region = QRegion(groupBox.rect)
if groupBox.text:
Expand Down
2 changes: 1 addition & 1 deletion manuskript/ui/editors/fullScreenEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def paintEvent(self, event):
# painter.restore()

# slider
r = style.subControlRect(style.CC_ScrollBar, opt, style.SC_ScrollBarSlider)
r = style.subControlRect(style.CC_ScrollBar, opt, style.SC_ScrollBarSlider, None)
painter.fillRect(r, self._color)
painter.end()

Expand Down

0 comments on commit 5d4aefd

Please sign in to comment.