-
Type:
Bug
-
Status: Closed
-
Priority:
P4: Low
-
Resolution: Done
-
Affects Version/s: 5.10.1
-
Fix Version/s: 5.11.0
-
Component/s: Documentation
-
Labels:None
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.
- resulted in
-
QTBUG-67253 Update QVariant::canConvert(int targetTypeId) conversion table
-
- Open
-