From 5d4aefdd9d0e98b00265acf55bea1e1359544e56 Mon Sep 17 00:00:00 2001 From: Brie Date: Mon, 12 Aug 2024 22:13:46 -0400 Subject: [PATCH] Fix more even more crashes with newer QT versions 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. --- manuskript/ui/collapsibleGroupBox.py | 10 +++++----- manuskript/ui/editors/fullScreenEditor.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manuskript/ui/collapsibleGroupBox.py b/manuskript/ui/collapsibleGroupBox.py index e6c1b442..3e21a16e 100644 --- a/manuskript/ui/collapsibleGroupBox.py +++ b/manuskript/ui/collapsibleGroupBox.py @@ -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()) @@ -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: diff --git a/manuskript/ui/editors/fullScreenEditor.py b/manuskript/ui/editors/fullScreenEditor.py index 229c8431..2b840e78 100644 --- a/manuskript/ui/editors/fullScreenEditor.py +++ b/manuskript/ui/editors/fullScreenEditor.py @@ -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()