From 6ea51cb7ca7de760b3e24a2cac3742b2593040ba Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Aug 2021 14:21:07 +0800 Subject: [PATCH] qtbase: remove std::remove_cv after using std::remove_pointer --- src/corelib/kernel/qobject.h | 12 ++++++------ src/widgets/graphicsview/qgraphicsitem.h | 4 ++-- src/widgets/styles/qstyleoption.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index c2fc2910f0f..13090c398a2 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -164,14 +164,14 @@ class Q_CORE_EXPORT QObject template inline T findChild(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename std::remove_cv::type>::type ObjType; + typedef typename std::remove_pointer::type ObjType; return static_cast(qt_qFindChild_helper(this, aName, ObjType::staticMetaObject, options)); } template inline QList findChildren(const QString &aName, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename std::remove_cv::type>::type ObjType; + typedef typename std::remove_pointer::type ObjType; QList list; qt_qFindChildren_helper(this, aName, ObjType::staticMetaObject, reinterpret_cast *>(&list), options); @@ -181,7 +181,7 @@ class Q_CORE_EXPORT QObject template QList findChildren(Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename std::remove_cv::type>::type ObjType; + typedef typename std::remove_pointer::type ObjType; QList list; qt_qFindChildren_helper(this, ObjType::staticMetaObject, reinterpret_cast *>(&list), options); @@ -192,7 +192,7 @@ class Q_CORE_EXPORT QObject template inline QList findChildren(const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename std::remove_cv::type>::type ObjType; + typedef typename std::remove_pointer::type ObjType; QList list; qt_qFindChildren_helper(this, re, ObjType::staticMetaObject, reinterpret_cast *>(&list), options); @@ -465,7 +465,7 @@ inline QMetaObject::Connection QObject::connect(const QObject *asender, const ch template inline T qobject_cast(QObject *object) { - typedef typename std::remove_cv::type>::type ObjType; + typedef typename std::remove_pointer::type ObjType; static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "qobject_cast requires the type to have a Q_OBJECT macro"); return static_cast(ObjType::staticMetaObject.cast(object)); @@ -474,7 +474,7 @@ inline T qobject_cast(QObject *object) template inline T qobject_cast(const QObject *object) { - typedef typename std::remove_cv::type>::type ObjType; + typedef typename std::remove_pointer::type ObjType; static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "qobject_cast requires the type to have a Q_OBJECT macro"); return static_cast(ObjType::staticMetaObject.cast(object)); diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h index 18d92c62aa7..cd5819eb116 100644 --- a/src/widgets/graphicsview/qgraphicsitem.h +++ b/src/widgets/graphicsview/qgraphicsitem.h @@ -1010,14 +1010,14 @@ class Q_WIDGETS_EXPORT QGraphicsItemGroup : public QGraphicsItem template inline T qgraphicsitem_cast(QGraphicsItem *item) { - typedef typename std::remove_cv::type>::type Item; + typedef typename std::remove_pointer::type Item; return int(Item::Type) == int(QGraphicsItem::Type) || (item && int(Item::Type) == item->type()) ? static_cast(item) : 0; } template inline T qgraphicsitem_cast(const QGraphicsItem *item) { - typedef typename std::remove_cv::type>::type Item; + typedef typename std::remove_pointer::type Item; return int(Item::Type) == int(QGraphicsItem::Type) || (item && int(Item::Type) == item->type()) ? static_cast(item) : 0; } diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index 0f412115219..8c751a4adf7 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -699,7 +699,7 @@ class Q_WIDGETS_EXPORT QStyleOptionGraphicsItem : public QStyleOption template T qstyleoption_cast(const QStyleOption *opt) { - typedef typename std::remove_cv::type>::type Opt; + typedef typename std::remove_pointer::type Opt; if (opt && opt->version >= Opt::Version && (opt->type == Opt::Type || int(Opt::Type) == QStyleOption::SO_Default || (int(Opt::Type) == QStyleOption::SO_Complex @@ -711,7 +711,7 @@ T qstyleoption_cast(const QStyleOption *opt) template T qstyleoption_cast(QStyleOption *opt) { - typedef typename std::remove_cv::type>::type Opt; + typedef typename std::remove_pointer::type Opt; if (opt && opt->version >= Opt::Version && (opt->type == Opt::Type || int(Opt::Type) == QStyleOption::SO_Default || (int(Opt::Type) == QStyleOption::SO_Complex @@ -762,7 +762,7 @@ class Q_WIDGETS_EXPORT QStyleHintReturnVariant : public QStyleHintReturn { template T qstyleoption_cast(const QStyleHintReturn *hint) { - typedef typename std::remove_cv::type>::type Opt; + typedef typename std::remove_pointer::type Opt; if (hint && hint->version <= Opt::Version && (hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default)) return static_cast(hint); @@ -772,7 +772,7 @@ T qstyleoption_cast(const QStyleHintReturn *hint) template T qstyleoption_cast(QStyleHintReturn *hint) { - typedef typename std::remove_cv::type>::type Opt; + typedef typename std::remove_pointer::type Opt; if (hint && hint->version <= Opt::Version && (hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default)) return static_cast(hint);