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 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> (cherry picked from commit f5b1dbb8f6966bea54799480e3c16e23f0d06d42) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
6b7c5d2daf
commit
b30fdad16a
@ -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()));
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ using namespace Qt::StringLiterals;
|
||||
QString qt_accStripAmp(const QString &text);
|
||||
QString qt_accHotKey(const QString &text);
|
||||
|
||||
QList<QWidget*> childWidgets(const QWidget *widget)
|
||||
QWidgetList _q_ac_childWidgets(const QWidget *widget)
|
||||
{
|
||||
QList<QWidget*> widgets;
|
||||
if (!widget)
|
||||
@ -80,8 +80,10 @@ QList<QWidget*> childWidgets(const QWidget *widget)
|
||||
#if QT_CONFIG(menu)
|
||||
&& !qobject_cast<QMenu*>(w)
|
||||
#endif
|
||||
// Exclude widgets used as implementation details
|
||||
&& objectName != "qt_rubberband"_L1
|
||||
&& objectName != "qt_qmainwindow_extended_splitter"_L1) {
|
||||
&& objectName != "qt_qmainwindow_extended_splitter"_L1
|
||||
&& objectName != "qt_spinbox_lineedit"_L1) {
|
||||
widgets.append(w);
|
||||
}
|
||||
}
|
||||
@ -1071,7 +1073,7 @@ QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)
|
||||
|
||||
QAccessibleInterface *QAccessibleMainWindow::child(int index) const
|
||||
{
|
||||
QList<QWidget*> kids = childWidgets(mainWindow());
|
||||
QList<QWidget*> kids = _q_ac_childWidgets(mainWindow());
|
||||
if (index >= 0 && index < kids.size()) {
|
||||
return QAccessible::queryAccessibleInterface(kids.at(index));
|
||||
}
|
||||
@ -1080,13 +1082,13 @@ QAccessibleInterface *QAccessibleMainWindow::child(int index) const
|
||||
|
||||
int QAccessibleMainWindow::childCount() const
|
||||
{
|
||||
QList<QWidget*> kids = childWidgets(mainWindow());
|
||||
QList<QWidget*> kids = _q_ac_childWidgets(mainWindow());
|
||||
return kids.size();
|
||||
}
|
||||
|
||||
int QAccessibleMainWindow::indexOfChild(const QAccessibleInterface *iface) const
|
||||
{
|
||||
QList<QWidget*> kids = childWidgets(mainWindow());
|
||||
QList<QWidget*> kids = _q_ac_childWidgets(mainWindow());
|
||||
return kids.indexOf(static_cast<QWidget*>(iface->object()));
|
||||
}
|
||||
|
||||
@ -1099,7 +1101,7 @@ QAccessibleInterface *QAccessibleMainWindow::childAt(int x, int y) const
|
||||
if (!QRect(gp.x(), gp.y(), w->width(), w->height()).contains(x, y))
|
||||
return nullptr;
|
||||
|
||||
const QWidgetList kids = childWidgets(mainWindow());
|
||||
const QWidgetList kids = _q_ac_childWidgets(mainWindow());
|
||||
QPoint rp = mainWindow()->mapFromGlobal(QPoint(x, y));
|
||||
for (QWidget *child : kids) {
|
||||
if (!child->isWindow() && !child->isHidden() && child->geometry().contains(rp)) {
|
||||
|
@ -63,7 +63,7 @@ using namespace Qt::StringLiterals;
|
||||
|
||||
#if QT_CONFIG(accessibility)
|
||||
|
||||
extern QList<QWidget*> childWidgets(const QWidget *widget);
|
||||
QWidgetList _q_ac_childWidgets(const QWidget *widget);
|
||||
|
||||
QString qt_accStripAmp(const QString &text);
|
||||
QString qt_accHotKey(const QString &text);
|
||||
@ -606,7 +606,7 @@ QAccessibleGroupBox::relations(QAccessible::Relation match /* = QAccessible::All
|
||||
QAccessibleWidget::relations(match);
|
||||
|
||||
if ((match & QAccessible::Labelled) && (!groupBox()->title().isEmpty())) {
|
||||
const QList<QWidget*> kids = childWidgets(widget());
|
||||
const QList<QWidget*> kids = _q_ac_childWidgets(widget());
|
||||
for (QWidget *kid : kids) {
|
||||
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(kid);
|
||||
if (iface)
|
||||
|
@ -1890,7 +1890,7 @@ bool QColorDialogPrivate::canBeNativeDialog() const
|
||||
return strcmp(QColorDialog::staticMetaObject.className(), q->metaObject()->className()) == 0;
|
||||
}
|
||||
|
||||
static const Qt::WindowFlags DefaultWindowFlags =
|
||||
static const Qt::WindowFlags qcd_DefaultWindowFlags =
|
||||
Qt::Dialog | Qt::WindowTitleHint
|
||||
| Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
|
||||
|
||||
@ -1950,7 +1950,7 @@ QColorDialog::QColorDialog(QWidget *parent)
|
||||
\a initial color.
|
||||
*/
|
||||
QColorDialog::QColorDialog(const QColor &initial, QWidget *parent)
|
||||
: QDialog(*new QColorDialogPrivate, parent, DefaultWindowFlags)
|
||||
: QDialog(*new QColorDialogPrivate, parent, qcd_DefaultWindowFlags)
|
||||
{
|
||||
Q_D(QColorDialog);
|
||||
d->init(initial);
|
||||
|
@ -3760,6 +3760,8 @@ void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index)
|
||||
*/
|
||||
void QFileDialogPrivate::_q_goToDirectory(const QString &path)
|
||||
{
|
||||
enum { UrlRole = Qt::UserRole + 1 };
|
||||
|
||||
#if QT_CONFIG(messagebox)
|
||||
Q_Q(QFileDialog);
|
||||
#endif
|
||||
|
@ -74,8 +74,6 @@ struct QFileDialogArgs
|
||||
QFileDialog::Options options = {};
|
||||
};
|
||||
|
||||
#define UrlRole (Qt::UserRole + 1)
|
||||
|
||||
class Q_WIDGETS_EXPORT QFileDialogPrivate : public QDialogPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QFileDialog)
|
||||
|
@ -69,7 +69,7 @@ QFontListView::QFontListView(QWidget *parent)
|
||||
setEditTriggers(NoEditTriggers);
|
||||
}
|
||||
|
||||
static const Qt::WindowFlags DefaultWindowFlags =
|
||||
static const Qt::WindowFlags qfd_DefaultWindowFlags =
|
||||
Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
|
||||
|
||||
QFontDialogPrivate::QFontDialogPrivate()
|
||||
@ -119,7 +119,7 @@ QFontDialogPrivate::~QFontDialogPrivate()
|
||||
\sa getFont()
|
||||
*/
|
||||
QFontDialog::QFontDialog(QWidget *parent)
|
||||
: QDialog(*new QFontDialogPrivate, parent, DefaultWindowFlags)
|
||||
: QDialog(*new QFontDialogPrivate, parent, qfd_DefaultWindowFlags)
|
||||
{
|
||||
Q_D(QFontDialog);
|
||||
d->init();
|
||||
|
@ -1651,19 +1651,7 @@ void QMainWindowLayout::setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::Ta
|
||||
updateTabBarShapes();
|
||||
}
|
||||
|
||||
static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position)
|
||||
{
|
||||
const bool rounded = (shape == QTabWidget::Rounded);
|
||||
if (position == QTabWidget::North)
|
||||
return rounded ? QTabBar::RoundedNorth : QTabBar::TriangularNorth;
|
||||
if (position == QTabWidget::South)
|
||||
return rounded ? QTabBar::RoundedSouth : QTabBar::TriangularSouth;
|
||||
if (position == QTabWidget::East)
|
||||
return rounded ? QTabBar::RoundedEast : QTabBar::TriangularEast;
|
||||
if (position == QTabWidget::West)
|
||||
return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest;
|
||||
return QTabBar::RoundedNorth;
|
||||
}
|
||||
QTabBar::Shape _q_tb_tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position);
|
||||
#endif // QT_CONFIG(tabwidget)
|
||||
|
||||
void QMainWindowLayout::updateTabBarShapes()
|
||||
@ -1689,7 +1677,7 @@ void QMainWindowLayout::updateTabBarShapes()
|
||||
for (int i = 0; i < QInternal::DockCount; ++i) {
|
||||
#if QT_CONFIG(tabwidget)
|
||||
QTabWidget::TabPosition pos = verticalTabsEnabled ? vertical[i] : tabPositions[i];
|
||||
QTabBar::Shape shape = tabBarShapeFrom(_tabShape, pos);
|
||||
QTabBar::Shape shape = _q_tb_tabBarShapeFrom(_tabShape, pos);
|
||||
#else
|
||||
QTabBar::Shape shape = verticalTabsEnabled ? vertical[i] : QTabBar::RoundedSouth;
|
||||
#endif
|
||||
|
@ -220,7 +220,7 @@ static inline QMdiArea *mdiAreaParent(QWidget *widget)
|
||||
}
|
||||
|
||||
#if QT_CONFIG(tabwidget)
|
||||
static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position)
|
||||
QTabBar::Shape _q_tb_tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position)
|
||||
{
|
||||
const bool rounded = (shape == QTabWidget::Rounded);
|
||||
if (position == QTabWidget::North)
|
||||
@ -1533,7 +1533,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode)
|
||||
tabBar->setTabsClosable(tabsClosable);
|
||||
tabBar->setMovable(tabsMovable);
|
||||
#if QT_CONFIG(tabwidget)
|
||||
tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition));
|
||||
tabBar->setShape(_q_tb_tabBarShapeFrom(tabShape, tabPosition));
|
||||
#endif
|
||||
|
||||
isSubWindowsTiled = false;
|
||||
@ -1597,7 +1597,7 @@ void QMdiAreaPrivate::updateTabBarGeometry()
|
||||
|
||||
Q_Q(QMdiArea);
|
||||
#if QT_CONFIG(tabwidget)
|
||||
Q_ASSERT(tabBarShapeFrom(tabShape, tabPosition) == tabBar->shape());
|
||||
Q_ASSERT(_q_tb_tabBarShapeFrom(tabShape, tabPosition) == tabBar->shape());
|
||||
#endif
|
||||
const QSize tabBarSizeHint = tabBar->sizeHint();
|
||||
|
||||
@ -1654,7 +1654,7 @@ void QMdiAreaPrivate::refreshTabBar()
|
||||
tabBar->setTabsClosable(tabsClosable);
|
||||
tabBar->setMovable(tabsMovable);
|
||||
#if QT_CONFIG(tabwidget)
|
||||
tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition));
|
||||
tabBar->setShape(_q_tb_tabBarShapeFrom(tabShape, tabPosition));
|
||||
#endif
|
||||
updateTabBarGeometry();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user