Qt hide QLayout (switch between two layouts)
Posted
by
Lodhart
on Stack Overflow
See other posts from Stack Overflow
or by Lodhart
Published on 2012-10-14T07:43:16Z
Indexed on
2012/10/14
9:37 UTC
Read the original article
Hit count: 154
I didn't find solution for my problem with two QLayouts. I need app with QHBoxLayout with possible expandind when I will add new widgets, push buttons, .... So what I have: One QDialog and two layouts. Now I know that I can't hide the layout. So I tray just :
layout()->removeItem(firstlayout);
layout()->addLayout(secondLayout);
But when I did this, I saw all items in first layout on possition [0,0]. So next step I try:
for (all items in first layout) if (widget) widget->hide();
But this is working only with QWidget and I have many different items in layouts.
Simply way is use the widget, because there is possibole to use hide/show, but I need auto expanding window when I add new items.
© Stack Overflow or respective owner