[Qt-interest] QByteArray bug?

Frank Hemer frank at hemer.org
Fri Jul 10 20:51:16 CEST 2009


I have a Method:

MyArray::getData (int len) {
   QByteArray arr;
   arr.resize (len);
   arr.data ();
   return arr;
}

>From another place, this is called:

MyArray myArray;
QByteArray arr = myArray.getData (x);
qDebug ("arr size: %i", arr.size ());

This works for all values of x
BUT NOT FOR 0??

if x is zero, the array size printed seems to be unpredictable.

Seems like a bug to me?!

Found in qt4.4.2

Frank




More information about the Qt-interest-old mailing list