Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.2.0 Beta1
-
None
-
cc584c59de644195ae0c4f7f99ad428e189df07d (qt/qtbase/dev) 62b4c9169c23f510747a384fe3f1ed78bee4b435 (qt/qtbase/6.2)
Description
I have the following piece of code which worked well in Qt 5:
QMap<QString,QString>::const_iterator i; for (i=ride->tags().constBegin(); i != ride->tags().constEnd(); i++) { out << "\t\t\t\"" << i.key() << "\": \"" << protect(i.value()) << "\""; if (i+1 != ride->tags().constEnd()) out << ",\n"; else out << "\n"; }
In Qt6, "i+1" is not possible any more. I get the error message:
FileIO/Snippets.cpp:149:26: error: no match for ‘operator+’ (operand types are ‘QMap<QString, QString>::const_iterator’ and ‘int’) 149 | if (i+1 != ride->tags().constEnd()) out << ",\n";
And I cannot find anything related in the porting guides
https://doc.qt.io/qt-6/portingguide.html
or
https://doc.qt.io/qt-6/qtcore-changes-qt6.html
Please bring back the "i+1" capability or provide guidance in the porting docs.
Attachments
Issue Links
- resulted from
-
QTBUG-90920 Build GoldenCheetah as QtBluetooth test application with Qt 6
- Closed