diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index a6b94660f6f..d4a4cdbe6f5 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -189,6 +189,14 @@ QRect ManhattanStyle::subElementRect(SubElement element, const QStyleOption *opt QRect ManhattanStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const { +#if QT_VERSION < QT_VERSION_CHECK(6, 2, 5) + // Workaround for QTBUG-101581, can be removed when building with Qt 6.2.5 or higher + if (control == CC_ScrollBar) { + const auto scrollbar = qstyleoption_cast(option); + if (scrollbar && qint64(scrollbar->maximum) - scrollbar->minimum > INT_MAX) + return QRect(); // breaks the scrollbar, but avoids the crash + } +#endif return QProxyStyle::subControlRect(control, option, subControl, widget); }