aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2014-02-28 11:07:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-28 12:08:46 +0100
commit6ef802ff6ed1cd234848b65fdad56dc3b0579cff (patch)
treeec709a1186d1a4ee71eeb036be203497a0e9def6 /src/quickwidgets
parent0a23e840e27964fad75e8b0ef7b31701c51f93d5 (diff)
QQuickWidget: handle hide and show events properly
Task-number: QTBUG-37062 Change-Id: I3763385168eaa0ccd009ada563f56ea0251029a5 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r--src/quickwidgets/qquickwidget.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index d530e0c18f..147762c66f 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -769,18 +769,27 @@ void QQuickWidget::mouseDoubleClickEvent(QMouseEvent *e)
d->offscreenWindow->mouseDoubleClickEvent(&mappedEvent);
}
-void QQuickWidget::showEvent(QShowEvent *e)
+void QQuickWidget::showEvent(QShowEvent *)
{
Q_D(QQuickWidget);
QQuickWindowPrivate::get(d->offscreenWindow)->forceRendering = true;
- d->offscreenWindow->showEvent(e);
+
+ d->updatePending = false;
+ triggerUpdate();
}
-void QQuickWidget::hideEvent(QHideEvent *e)
+void QQuickWidget::hideEvent(QHideEvent *)
{
Q_D(QQuickWidget);
QQuickWindowPrivate::get(d->offscreenWindow)->forceRendering = false;
- d->offscreenWindow->hideEvent(e);
+
+ QOpenGLContext *context = d->offscreenWindow->openglContext();
+ if (!context) {
+ qWarning("QQuickWidget::hideEvent with no context");
+ return;
+ }
+ context->makeCurrent(d->offscreenWindow);
+ d->renderControl->stop();
}
/*! \reimp */