diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-26 11:32:55 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-26 11:33:19 +0200 |
commit | 7810209ba32fcebfa90b081670595daaa5333a78 (patch) | |
tree | 98410d5cc7d9d762bbde0cb4eae8041aa6e2e542 /src/widgets/widgets/qmdisubwindow.cpp | |
parent | 6f2eabb54e3f827ebd2b90f68144b86342933869 (diff) | |
parent | 88625709058b386ee74cca536c6c5556159c99fa (diff) |
Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4ea2b77cc201daed94fbe321f146dfd20365a534
Diffstat (limited to 'src/widgets/widgets/qmdisubwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmdisubwindow.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index e25bc6de7a..685c5e159e 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -3141,8 +3141,6 @@ void QMdiSubWindow::paintEvent(QPaintEvent *paintEvent) } Q_D(QMdiSubWindow); - if (isMaximized() && !d->drawTitleBarWhenMaximized()) - return; if (d->resizeTimerId != -1) { // Only update the style option rect and the window title. @@ -3162,6 +3160,17 @@ void QMdiSubWindow::paintEvent(QPaintEvent *paintEvent) } QStylePainter painter(this); + QStyleOptionFrame frameOptions; + frameOptions.initFrom(this); + frameOptions.state.setFlag(QStyle::State_Active, d->isActive); + if (isMaximized() && !d->drawTitleBarWhenMaximized()) { + if (!autoFillBackground() && (!widget() || !qt_widget_private(widget())->isOpaque)) { + // make sure we paint all pixels of a maximized QMdiSubWindow if no-one else does + painter.drawPrimitive(QStyle::PE_FrameWindow, frameOptions); + } + return; + } + if (!d->windowTitle.isEmpty()) painter.setFont(d->font); painter.drawComplexControl(QStyle::CC_TitleBar, d->cachedStyleOptions); @@ -3169,10 +3178,7 @@ void QMdiSubWindow::paintEvent(QPaintEvent *paintEvent) if (isMinimized() && !d->hasBorder(d->cachedStyleOptions)) return; - QStyleOptionFrame frameOptions; - frameOptions.initFrom(this); frameOptions.lineWidth = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); - frameOptions.state.setFlag(QStyle::State_Active, d->isActive); // ### Ensure that we do not require setting the cliprect for 4.4 if (!isMinimized() && !d->hasBorder(d->cachedStyleOptions)) |