diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-01-12 15:01:07 +0100 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2023-01-14 00:20:34 +0100 |
commit | f5b1dbb8f6966bea54799480e3c16e23f0d06d42 (patch) | |
tree | bba6de9dddfd502df679405482f9a7cd354e7a91 /src/widgets/accessible/qaccessiblewidget.cpp | |
parent | ce104cac500096734a94e6d132e342d07d7e8af0 (diff) |
QtWidgets: Disambiguate static functions/variables and defines
They cause clashes in CMake Unity (Jumbo) builds.
Properly prefixing the childWidgets() function also prevents
it from cluttering static builds.
Task-number: QTBUG-109394
Pick-to: 6.5
Change-Id: Idd2b1ec748f33cfae8f3213847c43b3fb0550377
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/widgets/accessible/qaccessiblewidget.cpp')
-rw-r--r-- | src/widgets/accessible/qaccessiblewidget.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index 13f7eca898..b0bb12ea86 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -34,22 +34,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -static QList<QWidget*> childWidgets(const QWidget *widget) -{ - QList<QWidget*> widgets; - for (QObject *o : widget->children()) { - QWidget *w = qobject_cast<QWidget *>(o); - if (w && !w->isWindow() - && !qobject_cast<QFocusFrame*>(w) -#if QT_CONFIG(menu) - && !qobject_cast<QMenu*>(w) -#endif - && w->objectName() != "qt_rubberband"_L1 - && w->objectName() != "qt_spinbox_lineedit"_L1) - widgets.append(w); - } - return widgets; -} +QWidgetList _q_ac_childWidgets(const QWidget *widget); static QString buddyString(const QWidget *widget) { @@ -276,7 +261,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel // first check for all siblings that are labels to us // ideally we would go through all objects and check, but that // will be too expensive - const QList<QWidget*> kids = childWidgets(parent); + const QList<QWidget*> kids = _q_ac_childWidgets(parent); for (QWidget *kid : kids) { if (QLabel *labelSibling = qobject_cast<QLabel*>(kid)) { if (labelSibling->buddy() == widget()) { @@ -327,7 +312,7 @@ QAccessibleInterface *QAccessibleWidget::parent() const QAccessibleInterface *QAccessibleWidget::child(int index) const { Q_ASSERT(widget()); - QWidgetList childList = childWidgets(widget()); + QWidgetList childList = _q_ac_childWidgets(widget()); if (index >= 0 && index < childList.size()) return QAccessible::queryAccessibleInterface(childList.at(index)); return nullptr; @@ -355,7 +340,7 @@ QAccessibleInterface *QAccessibleWidget::focusChild() const /*! \reimp */ int QAccessibleWidget::childCount() const { - QWidgetList cl = childWidgets(widget()); + QWidgetList cl = _q_ac_childWidgets(widget()); return cl.size(); } @@ -364,7 +349,7 @@ int QAccessibleWidget::indexOfChild(const QAccessibleInterface *child) const { if (!child) return -1; - QWidgetList cl = childWidgets(widget()); + QWidgetList cl = _q_ac_childWidgets(widget()); return cl.indexOf(qobject_cast<QWidget *>(child->object())); } |