From 054645c846e94eb9aa14772685340ddb5d9a505f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20R=C3=B8dal?= Date: Fri, 3 Aug 2012 14:55:39 +0200 Subject: [PATCH] Do not call markDirty() for hidden widgets. Fixed crash when resizing a scroll area with a native viewport (typically a QGLWidget) causes the scroll bars to get hidden, while there are still expose events in the queue for the scroll bar widget. Task-number: QTBUG-26746 Change-Id: Ia77c8eb32a6730670333120af3f9a772c64807f1 Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidgetwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 10de176..6631342 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -492,7 +492,7 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event) m_widget->setAttribute(Qt::WA_Mapped); if (!event->region().isNull()) { // Exposed native widgets need to be marked dirty to get them repainted correctly. - if (m_widget->internalWinId() && !m_widget->isWindow() && m_widget->updatesEnabled()) { + if (m_widget->internalWinId() && !m_widget->isWindow() && m_widget->isVisible() && m_widget->updatesEnabled()) { if (QWidgetBackingStore *bs = m_widget->d_func()->maybeBackingStore()) bs->markDirty(event->region(), m_widget); } -- 2.7.4