Results 1 to 3 of 3

Thread: Removing item from layout without deleting it.

  1. #1
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Removing item from layout without deleting it.

    Hi. I've got a problem. I have a QFromLayout. And I want to remove item from layout without actual deleting that item. I've tried removeItem and takeAt functions but it doesn't work: items are still visible. My goal is to replace some items with others items, after button click, but I need to have access to data in items which aren't visible. Can you tell me what am I doing wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Removing item from layout without deleting it.

    Removing item from a layout doesn't remove it from the parent widget. If you want to remove a widget from its parent then call setParent() passing in 0.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    mrc_pl (25th January 2012)

  4. #3
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Removing item from layout without deleting it.

    Thank you So simple solution.

Similar Threads

  1. Replies: 8
    Last Post: 5th May 2021, 16:41
  2. Removing widget from layout
    By lotek in forum Newbie
    Replies: 13
    Last Post: 21st July 2011, 04:40
  3. Hiding Layout item - Layout does not use available space
    By Asperamanca in forum Qt Programming
    Replies: 0
    Last Post: 27th January 2011, 09:51
  4. removing an item from a treeWidget
    By user in forum Qt Programming
    Replies: 0
    Last Post: 13th November 2008, 01:19
  5. deleting first item in a list
    By soul_rebel in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2006, 17:49

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.