Qt Labs Forum » General discussions

How to replace a widget in a layout

(3 posts)

  1. venkatesh
    venkatesh
    Member

    Hi,
    i had been trying to replace a lable (widget 1) which has been set on QVBoxLayout by another lable (wdget 2). I am using the removeWidget method of QLayout for doing this. But nothing seems to be happening. If someone knows how to solve this then please do suggest how to go about doing this.

    Thanks in Advance
    -Venkatesh

    Posted: 1 month #
  2. Why not use a QStackWidget for toggling between windows to be displayed

    Posted: 1 month #
  3. teaser
    teaser
    Member

    If you call removeWidget() the widget is effectively removed from the layout but it still exists outside the layout. Do you want to show label 1 again later? If not, just delete it. If you do you could follow koder's suggestion or you can also just call hide() on label 1 and show() on label 2.

    Posted: 3 weeks #

RSS feed for this topic

Reply

You must log in to post.



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.