From 20000d92242b39fb34390f58759e2b05a3df33d6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 5 Feb 2015 16:10:03 +0100 Subject: QuickTestResult: Try a bit harder when stringifying a value Q_GADGETs are not always QVariant::toString()-convertible but they probably have their own toString() function that we always try to call. This may still lead to false posi- tives, but in a much smaller proportion. Change-Id: I80547a9e773e97410fe5d4723efcac6b010046f9 Reviewed-by: Caroline Chao --- src/qmltest/quicktestresult.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qmltest/quicktestresult.cpp') diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index f1558a6837..3f91ce85a8 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -496,7 +496,9 @@ void QuickTestResult::stringify(QQmlV4Function *args) } else { result = QLatin1String("Object"); } - } else { + } + + if (result.isEmpty()) { QString tmp = value->toQStringNoThrow(); if (value->asArrayObject()) result.append(QString::fromLatin1("[%1]").arg(tmp)); -- cgit v1.2.3