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/widgets/itemviews/qabstractitemdelegate.cpp | |
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/widgets/itemviews/qabstractitemdelegate.cpp')
-rw-r--r-- | src/widgets/itemviews/qabstractitemdelegate.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index bb47881c03..c5b22b5667 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -585,27 +585,27 @@ QString QAbstractItemDelegatePrivate::textForRole(Qt::ItemDataRole role, const Q case QMetaType::Float: text = locale.toString(value.toFloat()); break; - case QVariant::Double: + case QMetaType::Double: text = locale.toString(value.toDouble(), 'g', precision); break; - case QVariant::Int: - case QVariant::LongLong: + case QMetaType::Int: + case QMetaType::LongLong: text = locale.toString(value.toLongLong()); break; - case QVariant::UInt: - case QVariant::ULongLong: + case QMetaType::UInt: + case QMetaType::ULongLong: text = locale.toString(value.toULongLong()); break; - case QVariant::Date: + case QMetaType::QDate: text = locale.toString(value.toDate(), formatType); break; - case QVariant::Time: + case QMetaType::QTime: text = locale.toString(value.toTime(), formatType); break; - case QVariant::DateTime: + case QMetaType::QDateTime: text = locale.toString(value.toDateTime(), formatType); break; - case QVariant::Type(QMetaType::QJsonValue): { + case QMetaType::QJsonValue: { const QJsonValue val = value.toJsonValue(); if (val.isBool()) { text = QVariant(val.toBool()).toString(); |