Hello,
if im using a QList for images, images contains a null pointer after each iteration of the loop. It works fine with QLinkedList or QVector.
Why?
thanksCode:
while (i != files.end()) { images << img; i++; }
Garg
Printable View
Hello,
if im using a QList for images, images contains a null pointer after each iteration of the loop. It works fine with QLinkedList or QVector.
Why?
thanksCode:
while (i != files.end()) { images << img; i++; }
Garg
What null pointer?
E.g. there are 2 files, after iterating threw the while-loop...
QList:
...images contain two elements of type QImage, but they are 0x00000000.
QVector:
...images contain two elements of type QImage, but their adresses are valid locations.
Here an image of my vs debug output:
http://www.vxr.de/images/foo.jpg
What does img.isNull() return in both cases?
false in both cases.. hmmm
Is the code you posted the exact code you use?
Code:
{ while (i != files.end()) { images << img; i++; } else { "Datei " + *i + " konnte nicht geladen werden."); i++; } } }
thats it.
only the header file differs.
Code:
QList<QImage> images;
Code:
QVector<QImage> images;
And it works with vector but not with a list?
I tested it again. It works with both, i just misinterpreted the debug output ... i'm not very experienced with my IDE, sorry for that.
br
Garg