Results 1 to 3 of 3

Thread: Dynamically change the layout

  1. #1
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    10

    Default Dynamically change the layout

    I would like to dynamically change the widget displayed in a part of a window. According to the situation, another widget should be displayed.

    I have tried to remove the old widget from the layout and add the new one but it does not work.

    I have tried to delete the old layout and create a new one but it does not solve the problem.

    During these attempts, I have tried to repaint the window but it does not help.

    How could I do? I just need to replace dynamically a widget with another one in a "box" of the layout.

    Thanks!

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dynamically change the layout

    Take a look at QStackedLayout and QStackedWidget.
    I'm a rebel in the S.D.G.

  3. The following 2 users say thank you to lyuts for this useful post:

    jcyangzh (13th November 2012), pippo42 (12th November 2009)

  4. #3
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    10

    Default Re: Dynamically change the layout

    Thank you!

    This is exactly what I was looking for.

    In the meantime, I had done it with QTabWidget but this is what I needed.

    Thanks!

Similar Threads

  1. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 21:21
  2. Adding widgets dynamically
    By miw in forum Qt Programming
    Replies: 1
    Last Post: 23rd July 2009, 11:31
  3. Replies: 4
    Last Post: 16th March 2009, 10:08
  4. Hide widget, but not change layout
    By dimaz in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2008, 15:32
  5. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 18:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.