Pull QWidget::setTabOrder(std::initializer_list...) behind ABI boundary

Found in API-review.

Pick-to: 6.6
Change-Id: I261aa450d25288e7a3e8caa033ce5000e5dd77f2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Axel Spoerl 2023-08-09 11:33:35 +02:00 committed by Marc Mutz
parent 1530731694
commit a27cc5d727
2 changed files with 15 additions and 14 deletions

View File

@ -7085,6 +7085,20 @@ void QWidget::setTabOrder(QWidget* first, QWidget *second)
}
}
void QWidget::setTabOrder(std::initializer_list<QWidget *> widgets)
{
QWidget *prev = nullptr;
for (const auto &widget : widgets) {
if (!prev) {
prev = widget;
} else {
QWidget::setTabOrder(prev, widget);
prev = widget;
}
}
}
/*!\internal
Moves the relevant subwidgets of this widget from the \a oldtlw's

View File

@ -432,7 +432,7 @@ public:
void setFocusPolicy(Qt::FocusPolicy policy);
bool hasFocus() const;
static void setTabOrder(QWidget *, QWidget *);
static inline void setTabOrder(std::initializer_list<QWidget *> widgets);
static void setTabOrder(std::initializer_list<QWidget *> widgets);
void setFocusProxy(QWidget *);
QWidget *focusProxy() const;
Qt::ContextMenuPolicy contextMenuPolicy() const;
@ -914,19 +914,6 @@ inline bool QWidget::testAttribute(Qt::WidgetAttribute attribute) const
return testAttribute_helper(attribute);
}
inline void QWidget::setTabOrder(std::initializer_list<QWidget *> widgets)
{
QWidget *prev = nullptr;
for (const auto &widget : widgets) {
if (!prev) {
prev = widget;
} else {
QWidget::setTabOrder(prev, widget);
prev = widget;
}
}
}
#define QWIDGETSIZE_MAX ((1<<24)-1)
#ifndef QT_NO_DEBUG_STREAM