summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguivariant.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-05-15 15:40:58 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-18 21:42:58 +0200
commit8df298665a1e637ab6d26d5fcc447d5502afe31a (patch)
tree9d36f54835b70b04bd6ae0bc72aee2a8ea659143 /src/gui/kernel/qguivariant.cpp
parent6c06e14a49773ce5572935864ed6b9be219c6103 (diff)
Move QIcon metatype handlers back to QtGui
QIcon has been moved back from QWidget to QtGui, so the QIcon QVariant and QMetaType handler can now be moved back to QtGui. Also we can give back QIcon its old number, allowing to get rid of some compatibility hack when unstreaming QVariant Change-Id: I439d5c2987c06ecd619f394407850f678164afb8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
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;
}