QTabBar: share verticalTabs(Shape) with QStyleSheetStyle

... unbreaking -unity-build-batch-size 103.

As a drive-by, make the shared function constexpr and noexcept.

Task-number: QTBUG-115031
Pick-to: 6.6 6.5
Change-Id: I2bf30a280eccd896a5aa7de92c72aab30e797640
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Marc Mutz 2023-07-04 15:38:40 +02:00
parent 199a339f38
commit 19bfe3e0b1
3 changed files with 9 additions and 19 deletions

View File

@ -59,7 +59,7 @@
#include <private/qstyleanimation_p.h> #include <private/qstyleanimation_p.h>
#endif #endif
#if QT_CONFIG(tabbar) #if QT_CONFIG(tabbar)
#include <qtabbar.h> #include <private/qtabbar_p.h>
#endif #endif
#include <QMetaProperty> #include <QMetaProperty>
#if QT_CONFIG(mainwindow) #if QT_CONFIG(mainwindow)
@ -3076,16 +3076,6 @@ void QStyleSheetStyle::unpolish(QApplication *app)
styleSheetCaches->styleSheetCache.remove(qApp); styleSheetCaches->styleSheetCache.remove(qApp);
} }
#if QT_CONFIG(tabbar)
inline static bool verticalTabs(QTabBar::Shape shape)
{
return shape == QTabBar::RoundedWest
|| shape == QTabBar::RoundedEast
|| shape == QTabBar::TriangularWest
|| shape == QTabBar::TriangularEast;
}
#endif // QT_CONFIG(tabbar)
void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
const QWidget *w) const const QWidget *w) const
{ {

View File

@ -71,14 +71,6 @@ void QMovableTabWidget::paintEvent(QPaintEvent *e)
p.drawPixmap(0, 0, m_pixmap); p.drawPixmap(0, 0, m_pixmap);
} }
inline static bool verticalTabs(QTabBar::Shape shape)
{
return shape == QTabBar::RoundedWest
|| shape == QTabBar::RoundedEast
|| shape == QTabBar::TriangularWest
|| shape == QTabBar::TriangularEast;
}
void QTabBarPrivate::updateMacBorderMetrics() void QTabBarPrivate::updateMacBorderMetrics()
{ {
#if defined(Q_OS_MACOS) #if defined(Q_OS_MACOS)

View File

@ -245,6 +245,14 @@ public:
}; };
constexpr inline bool verticalTabs(QTabBar::Shape shape) noexcept
{
return shape == QTabBar::RoundedWest
|| shape == QTabBar::RoundedEast
|| shape == QTabBar::TriangularWest
|| shape == QTabBar::TriangularEast;
}
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif