Results 1 to 3 of 3

Thread: Dynamically change position of grid layout items

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Dynamically change position of grid layout items

    I am guessing that the leaks are the two QLayoutItem instances returned by the takeAt() calls. You can simply add a local variable to store the return value then call delete() on it.

    Qt's semantics for most takeAt() type calls is that ownership of whatever is being taken is transferred to the caller, so it is the caller's responsibility to clean up.
    Last edited by d_stranz; 3rd July 2019 at 18:44.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. The following user says thank you to d_stranz for this useful post:

    embeddedmz (4th July 2019)

  3. #2
    Join Date
    Jun 2019
    Location
    France, Pau
    Posts
    60
    Thanks
    32
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Dynamically change position of grid layout items

    Thank you very much, the leaks are gone !

Similar Threads

  1. Replies: 2
    Last Post: 14th November 2015, 01:15
  2. Replies: 0
    Last Post: 30th April 2013, 17:32
  3. To place images to a grid dynamically
    By athulms in forum Qt Quick
    Replies: 0
    Last Post: 28th July 2011, 07:35
  4. To place images to a grid dynamically
    By athulms in forum Newbie
    Replies: 0
    Last Post: 28th July 2011, 06:46
  5. Dynamically change the layout
    By pippo42 in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2009, 13:01

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.