Closed wsyong111 closed 11 months ago
当控件被使用addWidget添加到ExpandLayout中时对控件使用hide函数,控件依然会占用空间
如果这是预计行为请告诉我,并删除这个Issue
Windows10 22H2
Python 3.9.5 64Bit
PyQt6
1.3.4
将部件添加到ExpandLayout中,调用控件的hide函数 结果:控件即使被隐藏了依然会占位
from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton, QWidget from qfluentwidgets import ExpandLayout class Gui(QMainWindow): def __init__(self): super().__init__() self.resize(400, 400) self.content = QWidget(self) self.layout = ExpandLayout(self.content) self.btn1 = QPushButton("Button1", self.content) self.btn1.hide() self.btn2 = QPushButton("Button2", self.content) self.layout.addWidget(self.btn1) self.layout.addWidget(self.btn2) self.setCentralWidget(self.content) app = QApplication([]) win = Gui() win.show() app.exec()
这是由于未考虑控件可见性导致的,我已经修复。现在当控件不可见时,将直接跳该控件不进行布局,进而处理下一个控件。详情见 #599
What happened?
当控件被使用addWidget添加到ExpandLayout中时对控件使用hide函数,控件依然会占用空间
如果这是预计行为请告诉我,并删除这个Issue
Operation System
Windows10 22H2
Python Version
Python 3.9.5 64Bit
PyQt/PySide Version
PyQt6
PyQt/PySide-Fluent-Widgets Version
1.3.4
How to Reproduce?
将部件添加到ExpandLayout中,调用控件的hide函数 结果:控件即使被隐藏了依然会占位
Minimum code