Re: [Development] Is QMap Broken

2014-11-05 Thread Renaud Guezennec
"When iterating over a QHash , the items are arbitrarily ordered. With QMap, the items are always sorted by key." from: http://qt-project.org/doc/qt-5/qmap.html#details On 06/11/2014 01:36, Robert Steckroth wrote: Consider the following program, sho

[Development] Is QMap Broken

2014-11-05 Thread Robert Steckroth
Consider the following program, shouldn't the end() iterator place each key at the end of the newly created QMap. Instead, the keys and subsequent iterations are sorted (somehow). #include #include #include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv);

Re: [Development] QVector: clear while keeping capacity

2014-11-05 Thread Smith Martin
Good one! From: Pocheptsov Timur Sent: Wednesday, November 5, 2014 4:30 PM To: Smith Martin; Milian Wolff; Allan Sandfeld Jensen Cc: development@qt-project.org Subject: Re: [Development] QVector: clear while keeping capacity v.erase(v.begin(), v.end()) ?

Re: [Development] QVector: clear while keeping capacity

2014-11-05 Thread Pocheptsov Timur
v.erase(v.begin(), v.end()) ? From: development-bounces+timur.pocheptsov=theqtcompany@qt-project.org on behalf of Smith Martin Sent: Wednesday, November 5, 2014 3:36 PM To: Milian Wolff; Allan Sandfeld Jensen Cc: development@qt-project.org Subject:

Re: [Development] QVector: clear while keeping capacity

2014-11-05 Thread Smith Martin
I think there should be a way to empty the vector without losing the memory. I would have said clear() should do that, but clear() says it releases the memory. martin From: development-bounces+martin.smith=theqtcompany@qt-project.org on behalf of M

Re: [Development] QVector: clear while keeping capacity

2014-11-05 Thread Milian Wolff
On Wednesday 05 November 2014 14:33:00 Allan Sandfeld Jensen wrote: > On Wednesday 05 November 2014, Milian Wolff wrote: > > Hello all, > > > > could it be that QVector changed its behavior in Qt5? I just noticed that > > resize(0) does deallocate memory, which is highly unexpected from my side. >

Re: [Development] QVector: clear while keeping capacity

2014-11-05 Thread Allan Sandfeld Jensen
On Wednesday 05 November 2014, Milian Wolff wrote: > Hello all, > > could it be that QVector changed its behavior in Qt5? I just noticed that > resize(0) does deallocate memory, which is highly unexpected from my side. > See e.g. this old thread where it was said to use resize(0) to clear a > vect

[Development] QVector: clear while keeping capacity

2014-11-05 Thread Milian Wolff
Hello all, could it be that QVector changed its behavior in Qt5? I just noticed that resize(0) does deallocate memory, which is highly unexpected from my side. See e.g. this old thread where it was said to use resize(0) to clear a vector while keeping its capacity: http://comments.gmane.org/gm

[Development] QtQuick/QtGui/QtCore leak on exit

2014-11-05 Thread William Hallatt
Hi everyone, I have a QtQuick app (that links against external MS MFC libraries) that triggers memory leak warnings on exit. I have run the test app through both Dr Memory as well as BoundsChecker (both in VS 2008) and both report memory leaks stemming from the QtQuick and QtCore libraries. The