Remove some dead code

This code is now unused, as streaming operators are
registered automatically.

Change-Id: I0e48944c33a92cf1f2f158fb2dc0ca49256d7938
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Lars Knoll 2020-07-06 21:56:16 +02:00
parent ef6c5f29ab
commit fc4a08cee7
4 changed files with 0 additions and 84 deletions

View File

@ -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
{

View File

@ -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

View File

@ -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;

View File

@ -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;