Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qtbase: remove std::remove_cv after using std::remove_pointer #52

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/corelib/kernel/qobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ class Q_CORE_EXPORT QObject
template<typename T>
inline T findChild(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
typedef typename std::remove_pointer<T>::type ObjType;
return static_cast<T>(qt_qFindChild_helper(this, aName, ObjType::staticMetaObject, options));
}

template<typename T>
inline QList<T> findChildren(const QString &aName, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
typedef typename std::remove_pointer<T>::type ObjType;
QList<T> list;
qt_qFindChildren_helper(this, aName, ObjType::staticMetaObject,
reinterpret_cast<QList<void *> *>(&list), options);
Expand All @@ -181,7 +181,7 @@ class Q_CORE_EXPORT QObject
template<typename T>
QList<T> findChildren(Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
typedef typename std::remove_pointer<T>::type ObjType;
QList<T> list;
qt_qFindChildren_helper(this, ObjType::staticMetaObject,
reinterpret_cast<QList<void *> *>(&list), options);
Expand All @@ -192,7 +192,7 @@ class Q_CORE_EXPORT QObject
template<typename T>
inline QList<T> findChildren(const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
typedef typename std::remove_pointer<T>::type ObjType;
QList<T> list;
qt_qFindChildren_helper(this, re, ObjType::staticMetaObject,
reinterpret_cast<QList<void *> *>(&list), options);
Expand Down Expand Up @@ -465,7 +465,7 @@ inline QMetaObject::Connection QObject::connect(const QObject *asender, const ch
template <class T>
inline T qobject_cast(QObject *object)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
typedef typename std::remove_pointer<T>::type ObjType;
static_assert(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
"qobject_cast requires the type to have a Q_OBJECT macro");
return static_cast<T>(ObjType::staticMetaObject.cast(object));
Expand All @@ -474,7 +474,7 @@ inline T qobject_cast(QObject *object)
template <class T>
inline T qobject_cast(const QObject *object)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
typedef typename std::remove_pointer<T>::type ObjType;
static_assert(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value,
"qobject_cast requires the type to have a Q_OBJECT macro");
return static_cast<T>(ObjType::staticMetaObject.cast(object));
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/graphicsview/qgraphicsitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -1010,14 +1010,14 @@ class Q_WIDGETS_EXPORT QGraphicsItemGroup : public QGraphicsItem

template <class T> inline T qgraphicsitem_cast(QGraphicsItem *item)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Item;
typedef typename std::remove_pointer<T>::type Item;
return int(Item::Type) == int(QGraphicsItem::Type)
|| (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : 0;
}

template <class T> inline T qgraphicsitem_cast(const QGraphicsItem *item)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Item;
typedef typename std::remove_pointer<T>::type Item;
return int(Item::Type) == int(QGraphicsItem::Type)
|| (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/widgets/styles/qstyleoption.h
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class Q_WIDGETS_EXPORT QStyleOptionGraphicsItem : public QStyleOption
template <typename T>
T qstyleoption_cast(const QStyleOption *opt)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
typedef typename std::remove_pointer<T>::type Opt;
if (opt && opt->version >= Opt::Version && (opt->type == Opt::Type
|| int(Opt::Type) == QStyleOption::SO_Default
|| (int(Opt::Type) == QStyleOption::SO_Complex
Expand All @@ -711,7 +711,7 @@ T qstyleoption_cast(const QStyleOption *opt)
template <typename T>
T qstyleoption_cast(QStyleOption *opt)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
typedef typename std::remove_pointer<T>::type Opt;
if (opt && opt->version >= Opt::Version && (opt->type == Opt::Type
|| int(Opt::Type) == QStyleOption::SO_Default
|| (int(Opt::Type) == QStyleOption::SO_Complex
Expand Down Expand Up @@ -762,7 +762,7 @@ class Q_WIDGETS_EXPORT QStyleHintReturnVariant : public QStyleHintReturn {
template <typename T>
T qstyleoption_cast(const QStyleHintReturn *hint)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
typedef typename std::remove_pointer<T>::type Opt;
if (hint && hint->version <= Opt::Version &&
(hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
return static_cast<T>(hint);
Expand All @@ -772,7 +772,7 @@ T qstyleoption_cast(const QStyleHintReturn *hint)
template <typename T>
T qstyleoption_cast(QStyleHintReturn *hint)
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Opt;
typedef typename std::remove_pointer<T>::type Opt;
if (hint && hint->version <= Opt::Version &&
(hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
return static_cast<T>(hint);
Expand Down