diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2019-12-02 17:54:48 +0100 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2020-01-23 16:46:51 +0100 |
commit | 73d1476fb1397948a4d806bd921fce372bd8d63b (patch) | |
tree | a476349c26627027d78c1279da00ef633323311f /src/platformsupport | |
parent | a78d66743171557d79b16c08be775e3ac15bb4ef (diff) | |
download | qtbase-73d1476fb1397948a4d806bd921fce372bd8d63b.tar.gz |
Replace most use of QVariant::type and occurrences of QVariant::Type
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.
In addition, there was some manual changes to fix the compilation errors.
Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.
QVariant(QVariant::Invalid) in qstylesheet made no sense.
But note that in QVariant::save, we actually wanted to use the non-user type.
In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.
Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/platformsupport')
3 files changed, 3 insertions, 3 deletions
diff --git a/src/platformsupport/accessibility/qaccessiblebridgeutils.cpp b/src/platformsupport/accessibility/qaccessiblebridgeutils.cpp index f280e65c29..a15b93e31e 100644 --- a/src/platformsupport/accessibility/qaccessiblebridgeutils.cpp +++ b/src/platformsupport/accessibility/qaccessiblebridgeutils.cpp @@ -93,7 +93,7 @@ bool performEffectiveAction(QAccessibleInterface *iface, const QString &actionNa if (!success) return false; stepSize = (max - min) / 10; // this is pretty arbitrary, we just need to provide something - const int typ = currentVariant.type(); + const int typ = currentVariant.userType(); if (typ != QMetaType::Float && typ != QMetaType::Double) { // currentValue is an integer. Round it up to ensure stepping in case it was below 1 stepSize = qCeil(stepSize); diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 0f34e1a4ca..012edc82e4 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -2250,7 +2250,7 @@ bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path(); return false; } - if (!value.canConvert(QVariant::Double)) { + if (!value.canConvert(QMetaType::Double)) { qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function; } diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index 70d5616075..36d9e4e065 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -517,7 +517,7 @@ QFont *QKdeThemePrivate::kdeFont(const QVariant &fontValue) // causing recursion. QString fontDescription; QString fontFamily; - if (fontValue.type() == QVariant::StringList) { + if (fontValue.userType() == QMetaType::QStringList) { const QStringList list = fontValue.toStringList(); if (!list.isEmpty()) { fontFamily = list.first(); |