summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguivariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qguivariant.cpp')
-rw-r--r--src/gui/kernel/qguivariant.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 9d1294d588..8a5c083840 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -64,6 +64,7 @@
#include "qvector3d.h"
#include "qvector4d.h"
#include "qquaternion.h"
+#include "qicon.h"
// Core types
#include "qvariant.h"
@@ -137,7 +138,7 @@ static bool isNull(const QVariant::Private *d)
return QMetaTypeSwitcher::switcher<bool>(isNull, d->type, 0);
}
-// This class is a hack that customizes access to QPixmap, QBitmap and QCursor
+// This class is a hack that customizes access to QPixmap, QBitmap, QCursor and QIcon
template<class Filter>
class QGuiVariantComparator : public QVariantComparator<Filter> {
typedef QVariantComparator<Filter> Base;
@@ -164,6 +165,12 @@ public:
return v_cast<QCursor>(Base::m_a)->shape() == v_cast<QCursor>(Base::m_b)->shape();
}
#endif
+#ifndef QT_NO_ICON
+ bool delegate(const QIcon *)
+ {
+ return false;
+ }
+#endif
bool delegate(const void *p) { return Base::delegate(p); }
};
@@ -289,6 +296,13 @@ static bool convert(const QVariant::Private *d, int t,
}
}
#endif
+#ifndef QT_NO_ICON
+ case QVariant::Icon: {
+ if (ok)
+ *ok = false;
+ return false;
+ }
+#endif
default:
break;
}