Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.10.1
-
None
Description
The description of the QVariant::toString function reads:
Returns the variant as a QString if the variant has userType() QMetaType::QString, QMetaType::Bool, QMetaType::QByteArray, QMetaType::QChar, QMetaType::QDate, QMetaType::QDateTime, QMetaType::Double, QMetaType::Int, QMetaType::LongLong, QMetaType::QStringList, QMetaType::QTime, QMetaType::UInt, or QMetaType::ULongLong; otherwise returns an empty string.
However, there are several other values of QMetaType that will generate a non-empty string, namely: QMetaType::Float, QMetaType::Short, QMetaType::UShort, QMetaType::Long, QMetaType::ULong, QMetaType::SChar, QMetaType::UChar, etc...
I can only assume that this intended behaviour (why would Double be printed and not Float??), so I believe that the documentation is incorrect.
Attachments
Issue Links
- resulted in
-
QTBUG-67253 Update QVariant::canConvert(int targetTypeId) conversion table
- Open