From efaa849023d77dfee82e4d9ff904c3711b4fb611 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 20 Dec 2023 14:46:11 -0300 Subject: [PATCH] QObject: re-add the nameless qt_qFindChildren_helper to restore BC Amends e608bc019232f6956c4520be1a6103a1845c6991 by adding the implementation of this method whose implementation got accidentally removed (because it became unused). It's added in removed_api.cpp because, as the commit said, the cost for creating an empty QAnyStringView is practically nil. It's not zero on Windows, because the replacement function has five parameters, so the last (the options) is passed on the stack. But that is not enough of a justification to keep separate functions. Pick-to: 6.7 Fixes: QTBUG-120309 Change-Id: I6e2677aad2ab45759db2fffd17a29b4ec7728426 Reviewed-by: Rym Bouabid Reviewed-by: Ivan Solovev --- src/corelib/compat/removed_api.cpp | 6 ++++++ src/corelib/kernel/qobject.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 355d37bdb8..2f62a3055d 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -834,6 +834,12 @@ QDateTime QLocale::toDateTime(const QString &string, const QString &format, QCal #include "qobject.h" +void qt_qFindChildren_helper(const QObject *parent, const QMetaObject &mo, + QList *list, Qt::FindChildOptions options) +{ + qt_qFindChildren_helper(parent, QAnyStringView(), mo, list, options); +} + void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QMetaObject &mo, QList *list, Qt::FindChildOptions options) { diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 5180b2335a..9916626a3c 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -50,8 +50,10 @@ Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QString Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, QAnyStringView name, const QMetaObject &mo, QList *list, Qt::FindChildOptions options); +#if QT_CORE_REMOVED_SINCE(6, 7) Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QMetaObject &mo, QList *list, Qt::FindChildOptions options); +#endif Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QRegularExpression &re, const QMetaObject &mo, QList *list, Qt::FindChildOptions options); #if QT_CORE_REMOVED_SINCE(6, 7)