Results 1 to 3 of 3

Thread: Container's removing item problem.

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Container's removing item problem.

    Hi,

    Qt Code:
    1. cs_manager->getUnansweredCalls().clear();
    To copy to clipboard, switch view to plain text mode 

    does not clear the list(unanswered calls).

    But, the following clears the temp_list;

    Qt Code:
    1. QList<CallSession*> temp_list = cs_manager->getUnansweredCalls();
    2. temp_list .clear();
    To copy to clipboard, switch view to plain text mode 


    Any ideas?
    Last edited by zgulser; 23rd July 2012 at 12:07.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Container's removing item problem.

    please check what getUnansweredCalls() returns (I'll bet it is a copy).

    Since you did not show complete code it is impossible to say. Next time, please show complete compilable code.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Container's removing item problem.

    Thanks for your quicky response.

    I've found my error and it's very code specific. Thanks again.

Similar Threads

  1. help -- removing items from QList container
    By drinkwater in forum Newbie
    Replies: 4
    Last Post: 28th January 2012, 16:03
  2. Removing item from layout without deleting it.
    By mrc_pl in forum Qt Programming
    Replies: 2
    Last Post: 24th January 2012, 11:24
  3. Container item implementation
    By onurozcelik in forum Qt Programming
    Replies: 6
    Last Post: 12th May 2010, 12:00
  4. removing an item from a treeWidget
    By user in forum Qt Programming
    Replies: 0
    Last Post: 13th November 2008, 01: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.