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 <lars.knoll@nokia.com>
This commit is contained in:
Samuel Rødal 2012-08-03 14:55:39 +02:00 committed by Qt by Nokia
parent e033d59c94
commit 054645c846

View File

@ -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);
}