diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-14 17:13:58 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-16 10:31:20 +0000 |
commit | ff53707d666cf77b408373cc573e6ff5bc0bd3fb (patch) | |
tree | acb8e44a9a100bfc1921d47fa04f518d081e8c38 /src/animation/frontend | |
parent | 716ef2a1108347c37443c0d68d0e39d684fa75b2 (diff) |
Fix mix up regarding QVariant::isNull() and isValid()
Needs isValid() to check for a default constructed QVariant with
no underlying type yet. Using isNull() was a mistake since it will
be true for many default constructed types (0.0f, QVector3D(0), etc.)
Change-Id: I1c7ac10bbb0732a40b67e7dbf61ae5d4185ebac2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/animation/frontend')
-rw-r--r-- | src/animation/frontend/qchannelmapping.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/animation/frontend/qchannelmapping.cpp b/src/animation/frontend/qchannelmapping.cpp index 90504d942..faa77f5db 100644 --- a/src/animation/frontend/qchannelmapping.cpp +++ b/src/animation/frontend/qchannelmapping.cpp @@ -76,10 +76,10 @@ void QChannelMappingPrivate::updatePropertyNameAndType() type = mp.userType(); if (type == QMetaType::QVariant) { QVariant currentValue = m_target->property(mp.name()); - if (!currentValue.isNull()) { + if (currentValue.isValid()) { type = currentValue.userType(); } else { - qWarning("QChannelMapping: Attempted to target QVariant property with no value set." + qWarning("QChannelMapping: Attempted to target QVariant property with no value set. " "Set a value first in order to be able to determine the type."); } } |