aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-02-05 16:10:03 +0100
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-02-12 11:10:38 +0000
commit20000d92242b39fb34390f58759e2b05a3df33d6 (patch)
tree105decf63c2c53f487e8c17c580e33d72300390f /src/qmltest
parent005931905af62fb354c012594f9420d0acabbee3 (diff)
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 <caroline.chao@theqtcompany.com>
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/quicktestresult.cpp4
1 files changed, 3 insertions, 1 deletions
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));