After checking the source code of QWidget :: update (), I found that it calls this method in src/gui/kernel/qwidget.cpp:9544:
void QWidget::update(const QRect &rect)
{
if (!isVisible() || !updatesEnabled() || rect.isEmpty())
return;
if (testAttribute(Qt::WA_WState_InPaintEvent)) {
QApplication::postEvent(this, new QUpdateLaterEvent(rect));
return;
}
if (hasBackingStoreSupport()) {
QTLWExtra *tlwExtra = window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore)
tlwExtra->backingStore->markDirty(rect, this);
} else {
d_func()->repaint_sys(rect);
}
}
As you can see, it is QUpdateLaterEventpublished only if update () is already called from the paintEvent () method.
You can also check the source QWidget::repaint(const QRect &rect)on line 9456 - it lacks testAttribute(Qt::WA_WState_InPaintEvent)check.
EDIT
QUpdateLaterEvent Qt::NormalEventPriority, (. src/corelib/kernel/qcoreapplication.cpp:971 :1003). , compressEvent, .
, : QUpdateLaterEvent , , .