Details
-
Bug
-
Resolution: Done
-
P0: Blocker
-
4.6.3, 4.7.0
-
None
-
Ubuntu 8.10
2.6.24-27-generic #1 SMP Wed Mar 24 10:04:52 UTC 2010 i686 GNU/Linux
-
8060094144d6104659b8ce3b88d6f8b1e53cfb59
Description
In Qt 4.7.0-beta1 the assignment operator for QVarLengthArray has a wrong behaviour, it appends instead of replacing the data. It was working OK in previous Qt versions as far as I can tell.
Example code (attached as qmake project):
#include <QtCore/QCoreApplication> #include <QVarLengthArray> #include <QDebug> struct A { A() : a(false) {;} bool a; }; int main(int , char *[]) { QVarLengthArray<A,8 > sides1; sides1.resize(6); QVarLengthArray<A,8 > sides2; sides2.resize(7); sides2 = sides1; qDebug() << sides1.size() << sides2.size(); Q_ASSERT(sides1.size()==sides2.size()); // Output: 6 13 }