• 6055阅读
  • 4回复

QSplitter中加入QWidget [复制链接]

上一主题 下一主题
离线mysi
 
只看楼主 倒序阅读 楼主  发表于: 2009-09-24
QSplitter中加入QWidget之后,怎么将该QWidget删除,但是QWidget在其他地方还可以用?
离线mysi
只看该作者 1楼 发表于: 2009-09-24
我知道可以用addWidget加入QWidget,但是看了看Assistant,也没有发现有删除的?
离线mysi
只看该作者 2楼 发表于: 2009-09-25
请大侠们帮忙啊!
离线dbzhang800

只看该作者 3楼 发表于: 2009-09-25
void QSplitter::setSizes ( const QList<int> & list )

Sets the child widgets respective sizes to the values given in the list.

If the splitter is horizontal, the values set the widths of each widget in pixels, from left to right. If the splitter is vertical, the heights of each widget is set, from top to bottom.

Extra values in the list are ignored. If list contains too few values, the result is undefined but the program will still be well-behaved.

The overall size of the splitter widget is not affected. Instead, any additional/missing space is distributed amongst the widgets according to the relative weight of the sizes.

If you specify a size of 0, the widget will be invisible. The size policies of the widgets are preserved. That is, a value smaller then the minimal size hint of the respective widget will be replaced by the value of the hint.
离线mysi
只看该作者 4楼 发表于: 2009-09-29
to 楼上:
   首先,谢谢你给我回答问题啊。可是,我在c++里试过,好像大小设为0,这个widget只是隐藏了,并不是删除了。splitter中widget的count还是不变的。
快速回复
限100 字节
 
上一个 下一个