Fix build with -no-feature-mdiarea

qmainwindowlayout.cpp:(.text+0x2976): undefined reference to
`_q_tb_tabBarShapeFrom(QTabWidget::TabShape, QTabWidget::TabPosition)'

_q_tb_tabBarShapeFrom is implemented in qmdiarea.cpp which is not
compiled when the feature mdiarea is disabled.

Change-Id: Ib0c6447b9381b8ce01542fabf831a9db7f5e6675
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7346de649195d7fed39fa31ab1b11f42cd62f3a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tasuku Suzuki 2023-01-24 13:07:07 +09:00 committed by Qt Cherry-pick Bot
parent 32bc25d03f
commit 96636de2d7
2 changed files with 15 additions and 13 deletions

View File

@ -220,19 +220,7 @@ static inline QMdiArea *mdiAreaParent(QWidget *widget)
}
#if QT_CONFIG(tabwidget)
QTabBar::Shape _q_tb_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)
static inline QString tabTextFor(QMdiSubWindow *subWindow)

View File

@ -1407,6 +1407,20 @@ void QTabWidget::clear()
removeTab(0);
}
QTabBar::Shape _q_tb_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;
}
QT_END_NAMESPACE
#include "moc_qtabwidget.cpp"