diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-03-10 16:59:50 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-03-12 14:41:11 +0000 |
commit | 37f326297d45564298a2c8cb1958a81b858de57c (patch) | |
tree | 43aaabe1c4789d2e8c5696e11e6fcb9d2ebe9cc5 /src/widgets | |
parent | 70f92f8cee3f76385a426f62f4ee7e79945da5f2 (diff) |
QtWidgets: don't set Qt::WA_OutsideWSRange for 0-sized non-windows
If a widget which is not a window has a width or height of 0 that
doesn't mean we don't have to invalidate its backing store. On the
contrary, the backing store must be invalidated in order to clear stale
contents from previous paint events.
A window, however, can be completely ignored if it shrinks to 0 as the
window system will take care of it.
We don't have to clear the attribute for non-windows, either.
In Qt4 we use the Qt::WA_OutsideWSRange attribute only for widgets
which are windows when determining what to do with a geometry change.
See qwidget_x11.cpp or widget_win.cpp in Qt4.
Task-number: QTBUG-42727
Change-Id: I3655737057b803ad4b92601a9851055a81bd4b6d
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 65b861bc68..1c86e8cf7a 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7131,14 +7131,16 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) bool needsShow = false; - if (!(data.window_state & Qt::WindowFullScreen) && (w == 0 || h == 0)) { - q->setAttribute(Qt::WA_OutsideWSRange, true); - if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) - hide_sys(); - data.crect = QRect(x, y, w, h); - } else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) { - q->setAttribute(Qt::WA_OutsideWSRange, false); - needsShow = true; + if (q->isWindow()) { + if (!(data.window_state & Qt::WindowFullScreen) && (w == 0 || h == 0)) { + q->setAttribute(Qt::WA_OutsideWSRange, true); + if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) + hide_sys(); + data.crect = QRect(x, y, w, h); + } else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) { + q->setAttribute(Qt::WA_OutsideWSRange, false); + needsShow = true; + } } if (q->isVisible()) { |