如何从 QSplitter 中删除 QWidgets [英] How to remove QWidgets from QSplitter
本文介绍了如何从 QSplitter 中删除 QWidgets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中有一个由 QSplitter 分割的窗口,我需要删除一个小部件.
In my app have a window splitted by a QSplitter, and I need to remove an widget.
我该怎么做?我找不到有用的方法
How can I do that? I can't find useful methods
推荐答案
Qt 中的许多东西不能传统地"删除.而是在其上调用 hide() 并销毁它.来自 QSplitter 文档:
Many things in Qt cannot be "traditionally" removed. Instead call hide() on it and destruct it. From QSplitter documentation:
当你 hide() 一个孩子时,它的空间会在其他人之间分配孩子们.它将在何时恢复你再次显示()它.
When you hide() a child its space will be distributed among the other children. It will be reinstated when you show() it again.
这篇关于如何从 QSplitter 中删除 QWidgets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文