PDA

View Full Version : QString deletion



mukunda
14th March 2011, 06:32
Here is a sample code:


QList<QString> list;
QString value;
value.setNum(10,10);
for(int i=0;i<10;i++)
list.append(value);

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?

stampede
14th March 2011, 07:34
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 ).