Results 1 to 14 of 14

Thread: Removing widget from layout

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Apr 2011
    Posts
    124
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60
    Thanks
    1
    Thanked 10 Times in 10 Posts

    Default Re: Removing widget from layout

    Zlatomir, there is no interface (that I can find) to remove a widget from a QLayoutItem -- once it's in the layout item you can only delete the layout item.

    [To the OP:]
    Might we ask why you want to do all this in the first place? Why don't you just delete the entire layout and be done with it?

    At the very least, change your loop to work from the end backwards, or just delete item(0) cnt times.

    And remember, you need to check the item type. An item may be a spacer, or another layout.

    [And thanks to this strange forum software for glomming all my posts together, even though the later ones are directed at the OP.]
    Last edited by DanH; 17th July 2011 at 14:46.

Similar Threads

  1. Replies: 8
    Last Post: 5th May 2021, 16:41
  2. mainwindow layout vs widget layout
    By fatecasino in forum Newbie
    Replies: 2
    Last Post: 14th December 2010, 14:45
  3. (Solved) Removing (replacing) central widget
    By frenk_castle in forum Newbie
    Replies: 7
    Last Post: 14th December 2010, 10:02
  4. How to change a widget to other widget in layout?
    By Kevin Hoang in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2010, 10:55
  5. removing child widget
    By db in forum Newbie
    Replies: 1
    Last Post: 16th August 2007, 12:19

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
  •  
Qt is a trademark of The Qt Company.