QHBoxLayout清空子控件
QHBoxLayout清空子控件
layout = QHBoxLayout() widget1 = QLabel("Widget 1") widget2 = QLabel("Widget 2") widget3 = QLabel("Widget 3") layout.addWidget(widget1) layout.addWidget(widget2) layout.addWidget(widget3) # remove widget2 from the layout layout.removeWidget(widget2) widget2.deleteLater()
#####################
QQ 3087438119