Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0, 5.0.2
-
None
Description
The QJsonArray and QJsonObject iterators cannot be dereferenced with the -> operator, e.g. users must do:
#include <QDebug> #include <QJsonArray> int main(int argc, char *argv[]) { QJsonArray array; array.append(QJsonValue(1)); array.append(QJsonValue(QString::fromLatin1("2"))); array.append(QJsonValue(3)); for (QJsonArray::const_iterator vit = array.constBegin(), vitEnd = array.constEnd(); vit != vitEnd; ++vit) { if ((*vit).isString()) // if (vit->isString()) // Broken iterator here qDebug() << "I'm a string!"; } return 0; }
instead of the more common vit->isString().
Attachments
For Gerrit Dashboard: QTBUG-29573 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
92371,5 | Add operator-> to QJson iterators | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |