From 43720ec2003339918c51cddeee38c2b10ed27ddf Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 10 Dec 2018 14:58:18 +0100 Subject: [PATCH] Deprecate QObject::findChildren(const QRegExp &, ...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the overload using QRegularExpression instead. Change-Id: I1bf468b248c0a3f5b2304b1831379a127093df06 Reviewed-by: JÄ™drzej Nowacki --- src/corelib/kernel/qobject.cpp | 3 +++ src/corelib/kernel/qobject.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index d2a3d957e94..36c108b697f 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1820,12 +1820,15 @@ void QObject::killTimer(int id) /*! \fn template QList QObject::findChildren(const QRegExp ®Exp, Qt::FindChildOptions options) const \overload findChildren() + \obsolete Returns the children of this object that can be cast to type T and that have names matching the regular expression \a regExp, or an empty list if there are no such objects. The search is performed recursively, unless \a options specifies the option FindDirectChildrenOnly. + + Use the findChildren overload taking a QRegularExpression instead. */ /*! diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 9ae6155f52a..52c1b8e5559 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -176,7 +176,9 @@ public: } #ifndef QT_NO_REGEXP +#if QT_DEPRECATED_SINCE(5, 13) template + QT_DEPRECATED_X("Use findChildren(const RegularExpression &, ...) instead.") inline QList findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { typedef typename std::remove_cv::type>::type ObjType; @@ -186,6 +188,7 @@ public: return list; } #endif +#endif #if QT_CONFIG(regularexpression) template