diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cb7761add7..cfccce7c41 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -3040,7 +3040,8 @@ QList<QAction*> QWidget::actions() const Disabling a widget implicitly disables all its children. Enabling respectively enables all child widgets unless they have been - explicitly disabled. + explicitly disabled. It it not possible to explicitly enable a child + widget which is not a window while its parent widget remains disabled. By default, this property is true. @@ -9909,11 +9910,16 @@ void QWidget::update(const QRect &rect) */ void QWidget::update(const QRegion &rgn) { - if (!isVisible() || !updatesEnabled() || rgn.isEmpty()) + if (!isVisible() || !updatesEnabled()) + return; + + QRegion r = rgn & QWidget::rect(); + + if (r.isEmpty()) return; if (testAttribute(Qt::WA_WState_InPaintEvent)) { - QApplication::postEvent(this, new QUpdateLaterEvent(rgn)); + QApplication::postEvent(this, new QUpdateLaterEvent(r)); return; } @@ -9926,9 +9932,9 @@ void QWidget::update(const QRegion &rgn) #endif // Q_WS_MAC QTLWExtra *tlwExtra = window()->d_func()->maybeTopData(); if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) - tlwExtra->backingStoreTracker->markDirty(rgn, this); + tlwExtra->backingStoreTracker->markDirty(r, this); } else { - d_func()->repaint_sys(rgn); + d_func()->repaint_sys(r); } } |