Skip to content

Commit e31e5e2

Browse files
committed
canvas/stackedwidget: Check if the new geometry is the same as the old
Do nothing if they are the same. This is to prevent a possible infinite recursion. Equivalent-to: biolab/orange-canvas-core@0fa9053
1 parent 26ca8b8 commit e31e5e2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Orange/canvas/gui/stackedwidget.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class StackLayout(QStackedLayout):
5757
5858
"""
5959
def __init__(self, parent=None):
60+
self.__rect = QRect()
6061
QStackedLayout.__init__(self, parent)
6162
self.currentChanged.connect(self._onCurrentChanged)
6263

@@ -85,7 +86,16 @@ def maximumSize(self):
8586
else:
8687
return QStackedLayout.maximumSize(self)
8788

89+
def geometry(self):
90+
# Reimplemented due to QTBUG-47107.
91+
return QRect(self.__rect)
92+
8893
def setGeometry(self, rect):
94+
# type: (QRect) -> None
95+
if rect == self.__rect:
96+
return
97+
self.__rect = QRect(rect)
98+
8999
QStackedLayout.setGeometry(self, rect)
90100
for i in range(self.count()):
91101
w = self.widget(i)

0 commit comments

Comments
 (0)