diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-05-24 15:53:04 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-05-24 17:11:37 +0000 |
commit | 459933708a2ead6bedb0e2a47fcea474edfa07b8 (patch) | |
tree | 705f82af54e7c6f99bb4869bf2d64360cf65eefc /src/testlib/qtest.h | |
parent | 9ebe146feec91756280d03b08deaa2b17044cf48 (diff) |
Do an actual toString conversion for QVariant test failures
A cast is not a conversion. If the value is not already a string type
we are just getting an empty string for all metatypes that can be
converted to string.
Change-Id: I4643cc9fd509c21568fdc2133403c3ed8cb38a10
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r-- | src/testlib/qtest.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index c35b767875..6ab8d3d96b 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -160,7 +160,7 @@ template<> inline char *toString(const QVariant &v) if (!v.isNull()) { vstring.append(','); if (v.canConvert(QVariant::String)) { - vstring.append(qvariant_cast<QString>(v).toLocal8Bit()); + vstring.append(v.toString().toLocal8Bit()); } else { vstring.append("<value not representable as string>"); |