Results 1 to 2 of 2

Thread: QString deletion

  1. #1
    Join Date
    Jan 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QString deletion

    Here is a sample code:

    Qt Code:
    1. QList<QString> list;
    2. QString value;
    3. value.setNum(10,10);
    4. for(int i=0;i<10;i++)
    5. list.append(value);
    To copy to clipboard, switch view to plain text mode 

    Here is got a problem.It says that in the for loop, it is destroying the string value. So my application is exiting.

    Is there any suggestion for this?
    Last edited by wysota; 14th March 2011 at 07:37.

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QString deletion

    It says that in the for loop, it is destroying the string value. So my application is exiting.
    Who says that ?

    There are no problems in this code snippet, so I guess it'll be good if you show more code ( and answer the basic question - what is your Qt ver. and compiler ).

Similar Threads

  1. deletion problem with QGraphicsScene
    By spawn9997 in forum Qt Programming
    Replies: 2
    Last Post: 26th February 2010, 20:49
  2. Controling the deletion of objects?
    By mooreaa in forum Qt Programming
    Replies: 3
    Last Post: 4th July 2008, 18:08
  3. Custom model item deletion (Qt4.4)
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 22nd May 2008, 14:35
  4. QPointer and double deletion
    By mtrpoland in forum Qt Programming
    Replies: 6
    Last Post: 28th September 2007, 12: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.