Results 1 to 2 of 2

Thread: QSqlTableModel or any other mode freeing memory

  1. #1
    Join Date
    Jan 2011
    Posts
    32
    Thanks
    11
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSqlTableModel or any other mode freeing memory

    I want to free some memory by deleting all data from QSqlTableModel object. How can I achieve this without deleting whole object, because I want to use its filters and other settings afterwards? In other words after deleting if I call select() to get precise same data as before.
    ex.
    Qt Code:
    1. model->setTable();
    2. ...
    3. filters and blabla
    4. ...
    5. model->select(); //original model
    6. model->release(); //this is imagine
    7. //
    8. //I can see more memory available in TaskBar
    9. //
    10. model->select(); //i have original model again
    To copy to clipboard, switch view to plain text mode 

    Is there something like this?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QSqlTableModel or any other mode freeing memory

    I am not sure, but have you checked if clear() is also reseting the filters?

Similar Threads

  1. Replies: 2
    Last Post: 13th July 2011, 02:52
  2. Replies: 1
    Last Post: 2nd November 2009, 12:02
  3. freeing my memory (life should be lived forwards)
    By baray98 in forum General Programming
    Replies: 13
    Last Post: 25th September 2007, 23:33
  4. QT4 debug mode output / QList: Out of memory
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2007, 09:53
  5. Replies: 2
    Last Post: 6th December 2006, 23:41

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.