Skip to content

Commit 0d3b5ba

Browse files
zhiyiYoLocietta
andcommitted
修复手风琴组件的折叠问题
Co-authored-by: Locietta <[email protected]>
1 parent f8ec605 commit 0d3b5ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qfluentwidgets/components/settings/expand_setting_card.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def paintEvent(self, e):
151151
path.addRoundedRect(QRectF(self.rect().adjusted(1, 1, -1, -1)), 6, 6)
152152

153153
# set the bottom border radius to 0 if parent is expanded
154-
if p.isExpand:
154+
if hasattr(p, 'isExpand') and p.isExpand:
155155
path.addRect(1, self.height() - 8, self.width() - 2, 8)
156156

157157
painter.drawPath(path.simplified())
@@ -248,6 +248,7 @@ def __initWidget(self):
248248
def addWidget(self, widget: QWidget):
249249
""" add widget to tail """
250250
self.card.addWidget(widget)
251+
self._adjustViewSize()
251252

252253
def wheelEvent(self, e):
253254
pass
@@ -257,6 +258,8 @@ def setExpand(self, isExpand: bool):
257258
if self.isExpand == isExpand:
258259
return
259260

261+
self._adjustViewSize()
262+
260263
# update style sheet
261264
self.isExpand = isExpand
262265
self.setProperty('isExpand', isExpand)

0 commit comments

Comments
 (0)