summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qmetatype.h40
-rw-r--r--src/corelib/kernel/qmetatype_p.h14
-rw-r--r--src/gui/kernel/qguivariant.cpp15
-rw-r--r--src/widgets/kernel/qwidgetsvariant.cpp15
4 files changed, 0 insertions, 84 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 8e8ecac0a0..fb4a1989a6 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -651,46 +651,6 @@ ConverterFunctor<From, To, UnaryFunction>::~ConverterFunctor()
namespace QtMetaTypePrivate {
namespace QtMetaTypePrivate {
-template <typename T, bool Accepted = true>
-struct QMetaTypeFunctionHelper {
- static void Destruct(void *t)
- {
- Q_UNUSED(t); // Silence MSVC that warns for POD types.
- static_cast<T*>(t)->~T();
- }
-
- static void *Construct(void *where, const void *t)
- {
- if (t)
- return new (where) T(*static_cast<const T*>(t));
- return new (where) T;
- }
-#ifndef QT_NO_DATASTREAM
- static void Save(QDataStream &stream, const void *t)
- {
- stream << *static_cast<const T*>(t);
- }
-
- static void Load(QDataStream &stream, void *t)
- {
- stream >> *static_cast<T*>(t);
- }
-#endif // QT_NO_DATASTREAM
-};
-
-template <typename T>
-struct QMetaTypeFunctionHelper<T, /* Accepted */ false> {
- static void Destruct(void *) {}
- static void *Construct(void *, const void *) { return nullptr; }
-#ifndef QT_NO_DATASTREAM
- static void Save(QDataStream &, const void *) {}
- static void Load(QDataStream &, void *) {}
-#endif // QT_NO_DATASTREAM
-};
-template <>
-struct QMetaTypeFunctionHelper<void, /* Accepted */ true>
- : public QMetaTypeFunctionHelper<void, /* Accepted */ false>
-{};
struct VariantData
{
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
index cdb140a965..dedec4d469 100644
--- a/src/corelib/kernel/qmetatype_p.h
+++ b/src/corelib/kernel/qmetatype_p.h
@@ -132,10 +132,6 @@ class QMetaTypeModuleHelper
{
public:
virtual QtPrivate::QMetaTypeInterface *interfaceForType(int) const = 0;
-#ifndef QT_NO_DATASTREAM
- virtual bool save(QDataStream &stream, int type, const void *data) const = 0;
- virtual bool load(QDataStream &stream, int type, void *data) const = 0;
-#endif
};
namespace QtMetaTypePrivate {
@@ -209,16 +205,6 @@ static QT_PREPEND_NAMESPACE(QtPrivate::QMetaTypeInterface) *getInterfaceFromType
case QMetaType::MetaTypeName: \
return QtMetaTypePrivate::getInterfaceFromType<RealName>();
-#define QT_METATYPE_DATASTREAM_SAVE(MetaTypeName, MetaTypeId, RealName) \
- case QMetaType::MetaTypeName: \
- QtMetaTypePrivate::QMetaTypeFunctionHelper<RealName, QtMetaTypePrivate::TypeDefinition<RealName>::IsAvailable>::Save(stream, data); \
- return true;
-
-#define QT_METATYPE_DATASTREAM_LOAD(MetaTypeName, MetaTypeId, RealName) \
- case QMetaType::MetaTypeName: \
- QtMetaTypePrivate::QMetaTypeFunctionHelper<RealName, QtMetaTypePrivate::TypeDefinition<RealName>::IsAvailable>::Load(stream, data); \
- return true;
-
void derefAndDestroy(QT_PREPEND_NAMESPACE(QtPrivate::QMetaTypeInterface) *d_ptr);
} //namespace QtMetaTypePrivate
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index e592e2a9a5..fc8ed0f480 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -248,21 +248,6 @@ static const struct : QMetaTypeModuleHelper
default: return nullptr;
}
}
-#ifndef QT_NO_DATASTREAM
- bool save(QDataStream &stream, int type, const void *data) const override {
- switch (type) {
- QT_FOR_EACH_STATIC_GUI_CLASS(QT_METATYPE_DATASTREAM_SAVE)
- default: return false;
- }
- }
- bool load(QDataStream &stream, int type, void *data) const override {
- switch (type) {
- QT_FOR_EACH_STATIC_GUI_CLASS(QT_METATYPE_DATASTREAM_LOAD)
- default: return false;
- }
- }
-#endif
-
} qVariantGuiHelper;
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp
index 51e2130433..27d4d9e2fe 100644
--- a/src/widgets/kernel/qwidgetsvariant.cpp
+++ b/src/widgets/kernel/qwidgetsvariant.cpp
@@ -71,21 +71,6 @@ static const struct : QMetaTypeModuleHelper
default: return nullptr;
}
}
-#ifndef QT_NO_DATASTREAM
- bool save(QDataStream &stream, int type, const void *data) const override {
- switch (type) {
- QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_METATYPE_DATASTREAM_SAVE)
- default: return false;
- }
- }
- bool load(QDataStream &stream, int type, void *data) const override {
- switch (type) {
- QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_METATYPE_DATASTREAM_LOAD)
- default: return false;
- }
- }
-#endif
-
} qVariantWidgetsHelper;