diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index a37a282bb56..6ad3ef30d32 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -24,6 +24,9 @@ #if QT_CONFIG(datetimeedit) # include #endif +#if QT_CONFIG(tabwidget) +# include +#endif #include "qdrawutil.h" #include @@ -2030,7 +2033,10 @@ QSize QWindows11Style::sizeFromContents(ContentsType type, const QStyleOption *o constexpr int hPadding = 2 * 11; constexpr int itemHeight = 32; contentSize.setWidth(contentSize.width() + hMargin + hPadding); - contentSize.setHeight(itemHeight); +#if QT_CONFIG(tabwidget) + if (widget->parent() && !qobject_cast(widget->parent())) +#endif + contentSize.setHeight(itemHeight); } break; #endif