From 9a0b7348b3548c5062db28129b11a8f1abbd7540 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 18 Jun 2012 09:46:35 +0200 Subject: Make QSignalSpy copy QVariant parameters directly Previously, a QVariant parameter would be wrapped inside a new QVariant, and you would have to cast the QSignalSpy's QVariant to a QVariant to get the actual value. This behavior was unintuitive and undocumented. Check if the parameter type is QVariant, and copy it directly if it is. This makes the QSignalSpy's QVariant directly usable (no need to "unwrap" the value in user code). Existing tests that use QSignalSpy together with QVariant parameters (such as tst_QPropertyAnimation::valueChanged()) and do cast the QVariant parameter to a QVariant, continue to work after this change; this is because qvariant_cast() returns its input value (unchanged) when the type is not QMetaType::QVariant. Task-number: QTBUG-21645 Change-Id: Ibfb171edd60c0d3f7ca1d5419e5c5f3d0380d5b3 Reviewed-by: Jason McDonald --- dist/changes-5.0.0 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dist') diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 8daf897459..93b49ecf05 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -499,6 +499,11 @@ QTestLib -------- * [QTBUG-20615] Autotests can now log test output to multiple destinations and log formats simultaneously. +* [QTBUG-21645] QSignalSpy now handles QVariant signal parameters more + intuitively; the QVariant value is copied directly, instead of being + wrapped inside a new QVariant. This means that calling + qvariant_cast() on the QSignalSpy item (to "unwrap" the value) + is no longer required (but still works). QtSql ----- -- cgit v1.2.3