From e5ce564b1d2f2818c36ffbabbaa558c091512e66 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 6 Oct 2011 13:25:58 +0200 Subject: Rename QMetaType::construct() to create() create() is symmetric with destroy(). Also rename the internal methods and fields to be consistent (qDeleteHelper already had the "right" name, though!). This change will allow us to use construct() and destruct() for something else: Placement new-style allocation (QTBUG-12574). The old construct() is still kept for now, until the other repositories have been updated to use create(). Change-Id: Iceb184af6cffcb0a634359cfc3516c718ba0c2f5 Reviewed-on: http://codereview.qt-project.org/6342 Sanity-Review: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidgetsvariant.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/widgets/kernel/qwidgetsvariant.cpp') diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp index c8ba07fa81..a349e161e3 100644 --- a/src/widgets/kernel/qwidgetsvariant.cpp +++ b/src/widgets/kernel/qwidgetsvariant.cpp @@ -135,8 +135,8 @@ static const QVariant::Handler widgets_handler = { struct QMetaTypeGuiHelper { - QMetaType::Constructor constr; - QMetaType::Destructor destr; + QMetaType::Creator creator; + QMetaType::Deleter deleter; #ifndef QT_NO_DATASTREAM QMetaType::SaveOperator saveOp; QMetaType::LoadOperator loadOp; @@ -148,16 +148,16 @@ extern Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeWidgetsHelper; #ifdef QT_NO_DATASTREAM # define Q_DECL_METATYPE_HELPER(TYPE) \ - typedef void *(*QConstruct##TYPE)(const TYPE *); \ - static const QConstruct##TYPE qConstruct##TYPE = qMetaTypeConstructHelper; \ - typedef void (*QDestruct##TYPE)(TYPE *); \ - static const QDestruct##TYPE qDestruct##TYPE = qMetaTypeDeleteHelper; + typedef void *(*QCreate##TYPE)(const TYPE *); \ + static const QCreate##TYPE qCreate##TYPE = qMetaTypeCreateHelper; \ + typedef void (*QDelete##TYPE)(TYPE *); \ + static const QDelete##TYPE qDelete##TYPE = qMetaTypeDeleteHelper; #else # define Q_DECL_METATYPE_HELPER(TYPE) \ - typedef void *(*QConstruct##TYPE)(const TYPE *); \ - static const QConstruct##TYPE qConstruct##TYPE = qMetaTypeConstructHelper; \ - typedef void (*QDestruct##TYPE)(TYPE *); \ - static const QDestruct##TYPE qDestruct##TYPE = qMetaTypeDeleteHelper; \ + typedef void *(*QCreate##TYPE)(const TYPE *); \ + static const QCreate##TYPE qCreate##TYPE = qMetaTypeCreateHelper; \ + typedef void (*QDelete##TYPE)(TYPE *); \ + static const QDelete##TYPE qDelete##TYPE = qMetaTypeDeleteHelper; \ typedef void (*QSave##TYPE)(QDataStream &, const TYPE *); \ static const QSave##TYPE qSave##TYPE = qMetaTypeSaveHelper; \ typedef void (*QLoad##TYPE)(QDataStream &, TYPE *); \ @@ -171,12 +171,12 @@ Q_DECL_METATYPE_HELPER(QSizePolicy) #ifdef QT_NO_DATASTREAM # define Q_IMPL_METATYPE_HELPER(TYPE) \ - { reinterpret_cast(qConstruct##TYPE), \ - reinterpret_cast(qDestruct##TYPE) } + { reinterpret_cast(qCreate##TYPE), \ + reinterpret_cast(qDelete##TYPE) } #else # define Q_IMPL_METATYPE_HELPER(TYPE) \ - { reinterpret_cast(qConstruct##TYPE), \ - reinterpret_cast(qDestruct##TYPE), \ + { reinterpret_cast(qCreate##TYPE), \ + reinterpret_cast(qDelete##TYPE), \ reinterpret_cast(qSave##TYPE), \ reinterpret_cast(qLoad##TYPE) \ } -- cgit v1.2.3