diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 748f8fa5e33..83aa4090a50 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -1373,7 +1373,7 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op if (const QStyleOptionProgressBar* progbaropt = qstyleoption_cast(option)) { QRect rect = subElementRect(SE_ProgressBarLabel, progbaropt, widget); painter->setPen(progbaropt->palette.text().color()); - painter->drawText(rect, progbaropt->text,Qt::AlignVCenter|Qt::AlignLeft); + painter->drawText(rect, progbaropt->text,progbaropt->textAlignment); } break; case CE_PushButtonLabel: @@ -1857,6 +1857,15 @@ QRect QWindows11Style::subElementRect(QStyle::SubElement element, const QStyleOp ret = QWindowsVistaStyle::subElementRect(element, option, widget); } break; + case QStyle::SE_ProgressBarLabel: + if (const QStyleOptionProgressBar *pb = qstyleoption_cast(option)) { + if (pb->textAlignment.testFlags(Qt::AlignVCenter)) { + ret = option->rect.adjusted(0, 6, 0, 0); + } else { + ret = QWindowsVistaStyle::subElementRect(element, option, widget); + } + } + break; case QStyle::SE_HeaderLabel: case QStyle::SE_HeaderArrow: ret = QCommonStyle::subElementRect(element, option, widget);