简体   繁体   English

PyQt在QTreeWidget中隐藏QDialogs

[英]PyQt Hide QDialogs Inside of QTreeWidget

I have a QTreeWidget with QComboBoxes inside of it. 我有一个带有QComboBoxes的QTreeWidget。 I would like to be able to hide the combo boxes. 我希望能够隐藏组合框。

I am getting the QComboBox out of the tree using the itemWidget function. 我正在使用itemWidget函数从树中获取QComboBox。 I have tried using setVisible(False) and hide() but neither work. 我试过使用setVisible(False)和hide(),但都没有用。 Can anyone explain why this is the case and possibly offer a soultion? 谁能解释为什么会这样,并可能提供一种慰藉?

I suspect it has something to do with the QTreeWidget or the QTreeWidgetItems controlling the visibility of its widgets. 我怀疑这与控制其窗口小部件的可见性的QTreeWidget或QTreeWidgetItems有关。

您是否尝试过将QComboBoxes放在QWidget的布局中,然后将QWidget放在QTreeWidget中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM