Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8
-
None
-
-
29dfcc240 (dev), 46ec49894 (6.8)
Description
QDirListing::const_iterator seems to point to a common instance, hence changing an iterator changes other instances:
QDirListing l(QDir::homePath()); auto it1 = l.begin(); qDebug() << "it1=" << it1->absoluteFilePath(); auto it2 = it1++; qDebug("it2 = it1++"); qDebug() << "it1=" << it1->absoluteFilePath(); qDebug() << "it2=" << it2->absoluteFilePath();
produces
Qt 6.8.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 13.2.0) it1= "/home/user/Public" it2 = it1++ it1= "/home/user/tmp" it2= "/home/user/tmp"
it2 should still point to "/home/user/Public".
This was noticed during creating the Python bindings, here I need to emulate Java-Style iterators with next()/value() for the Python iterable protocol.
Attachments
Issue Links
- relates to
-
QTBUG-124646 QDirListing QDir::NoFilter filters
- Closed
-
PYSIDE-2620 Adapt to 6.8
- Closed