Closed Changgeng-Wei closed 1 year ago
在Setting_card_group中,如果隐藏其中的某一个card,这个card会留下空白,card_group不会自动调整尺寸,adjustsize()也没用, 不知道是不是有什么可以设置吗?我对源码进行了修改,改善了这个问题,在qfluentwidgets.components.layout.expand_layout的__doLayout()中加入if w.isHidden():continue。具体如下:
for i, w in enumerate(self.__widgets): if w.isHidden(): continue y += (i > 0) * self.spacing() if move: w.setGeometry(QRect(QPoint(x, y), QSize(width, w.height()))) y += w.height()
这个布局类是给 SongCardGroup 内部使用的,设计的时候没有考虑隐藏的问题。直接用 QVBoxLayout 应该也能实现相同效果的
SongCardGroup
在Setting_card_group中,如果隐藏其中的某一个card,这个card会留下空白,card_group不会自动调整尺寸,adjustsize()也没用, 不知道是不是有什么可以设置吗?我对源码进行了修改,改善了这个问题,在qfluentwidgets.components.layout.expand_layout的__doLayout()中加入if w.isHidden():continue。具体如下: