diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 66b1ae4f544..53f6051d06e 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 @@ -2000,7 +2003,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