QQuickWidget show/hide/raise fix

Make sure the alphamask in the backingstore is updated whenever the
state of a QQuickWidget/QOpenGLWidget child changes.

Task-number: QTBUG-37062
Change-Id: Iffa80fc8993499a15bc9e773a162a3f98b81ae03
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This commit is contained in:
Paul Olav Tvete 2014-02-28 12:50:48 +01:00 committed by The Qt Project
parent d307785381
commit 5cd7390ba9

View File

@ -524,7 +524,10 @@ void QWidgetPrivate::show_sys()
return;
}
QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
if (renderToTexture && !q->isWindow())
QApplication::postEvent(q->parentWidget(), new QUpdateLaterEvent(q->geometry()));
else
QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow))
return;
@ -588,7 +591,10 @@ void QWidgetPrivate::hide_sys()
if (!q->isWindow()) {
QWidget *p = q->parentWidget();
if (p &&p->isVisible()) {
invalidateBuffer(q->rect());
if (renderToTexture)
p->d_func()->invalidateBuffer(q->geometry());
else
invalidateBuffer(q->rect());
}
} else {
invalidateBuffer(q->rect());
@ -663,6 +669,11 @@ void QWidgetPrivate::raise_sys()
Q_Q(QWidget);
if (q->isWindow() || q->testAttribute(Qt::WA_NativeWindow)) {
q->windowHandle()->raise();
} else if (renderToTexture) {
if (QWidget *p = q->parentWidget()) {
setDirtyOpaqueRegion();
p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
}
}
}