pyqt: how to remove a widget?

前端 未结 2 1685
再見小時候
再見小時候 2020-12-09 02:23

I have a QGroupBox widget with children in it that I want to remove. How do I do that? I can\'t find any removeWidget, removeChild,

2条回答
  •  清歌不尽
    2020-12-09 02:45

    Well, this works: on the widget i want to remove, call widget.setParent(None). I like how adding to a layout adds a widget to the container, but removing from a layout doesn't... fun stuff.

提交回复
热议问题