Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3
-
None
-
Gentoo Linux
-
9e5df4ae5 (dev), bab635fea (6.6), 47eb8b332 (6.5)
Description
The documentation QStringDecoder and QStringEncoder incorrectly states that the encoding methods return a QByteArray and the decoding methods return a QString, where they instead return some other undocumented structures. This causes code like the following to fail to compile:
[](QByteArray const & v) { QStringDecoder decoder("UTF-8"); auto result = decoder(v); if (!decoder.hasError()) return result; return QString("huh?"); }(input);
with errors like:
main.cpp: In lambda function: main.cpp:9:15: error: inconsistent types 'QStringDecoder::EncodedData<const QByteArray&>' and 'QString' deduced for lambda return type 9 | return QString("huh?"); | ^~~~~~~~~~~~~~~ main.cpp:9:29: error: no matching function for call to 'QStringDecoder::EncodedData<const QByteArray&>::EncodedData(QString)' 9 | return QString("huh?"); | ^
Attachments
For Gerrit Dashboard: QTBUG-117705 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
509856,3 | QStringConverter: clarify decode()/encode() API docs | dev | qt/qtbase | Status: MERGED | +2 | 0 |
510156,2 | QStringConverter: clarify decode()/encode() API docs | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
510189,2 | QStringConverter: clarify decode()/encode() API docs | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |