summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetsvariant.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-06-08 12:55:43 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-13 08:48:03 +0200
commit50c96c17b6c87d48418336dc124a6de3f1f1958b (patch)
tree962402f22076847ba61a1877a269bac8460beb3b /src/widgets/kernel/qwidgetsvariant.cpp
parent2002158a13517411ba797788331e8865cca514e5 (diff)
Use the new support for comparisons in QMetaType for QVariant
Remove the compare method in the QVariant::Handler struct. Rely on the generic support provided by QMetaType instead. [ChangeLog][Important Behavior Changes][QVariant] QVariant will now use builtin support in QMetaType to compare its content. This implies a behavioral change for some graphical types like QPixmap, QImage and QIcon that will never compare equal in Qt 6 (as they do not have a comparison operator). Change-Id: I30a6e7116c89124d11ed9052537cecc23f78116e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidgetsvariant.cpp')
-rw-r--r--src/widgets/kernel/qwidgetsvariant.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp
index 15a48bf683..31bb92bb2e 100644
--- a/src/widgets/kernel/qwidgetsvariant.cpp
+++ b/src/widgets/kernel/qwidgetsvariant.cpp
@@ -54,18 +54,6 @@ static bool isNull(const QVariant::Private *)
return false;
}
-static bool compare(const QVariant::Private *a, const QVariant::Private *b)
-{
- Q_ASSERT(a->type() == b->type());
- switch (a->type().id()) {
- case QMetaType::QSizePolicy:
- return *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b);
- default:
- Q_ASSERT(false);
- }
- return false;
-}
-
static bool convert(const QVariant::Private *d, int type, void *result, bool *ok)
{
Q_UNUSED(d);
@@ -92,7 +80,6 @@ static void streamDebug(QDebug dbg, const QVariant &v)
static const QVariant::Handler widgets_handler = {
isNull,
- compare,
convert,
#if !defined(QT_NO_DEBUG_STREAM)
streamDebug