update()

В двух словах update() вызывает QPaintEvent для текущего виджета.

На размер виджета update никак не влияет.

В случае изменения размера update вызывается автоматически.

Поэтому вызывать его отдельно в общем-то и не надо.

В отличии от метода repaint метод update помещает QPaintEvent в очередь событий.

void QWidget::update()
{
    update(rect());
}

Updates the widget unless updates are disabled or the widget is hidden.

This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize for more speed and less flicker than a call to repaint() does.

Calling update() several times normally results in just one paintEvent() call.

Qt normally erases the widget's area before the paintEvent() call. If the Qt::WA_OpaquePaintEvent widget attribute is set, the widget is responsible for painting all its pixels with an opaque color.

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()) {
#ifdef QT_MAC_USE_COCOA
        if (qt_widget_private(this)->isInUnifiedToolbar) {
            qt_widget_private(this)->unifiedSurface->renderToolbar(this, true);
            return;
        }
#endif // QT_MAC_USE_COCOA
        QTLWExtra *tlwExtra = window()->d_func()->maybeTopData();
        if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore)
            tlwExtra->backingStore->markDirty(rect, this);
    } else {
        d_func()->repaint_sys(rect);
    }
}

попадаем обычно в markDirty

void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool updateImmediately,
                                    bool invalidateBuffer)
{
    Q_ASSERT(tlw->d_func()->extra);
    Q_ASSERT(tlw->d_func()->extra->topextra);
    Q_ASSERT(!tlw->d_func()->extra->topextra->inTopLevelResize);
    Q_ASSERT(widget->isVisible() && widget->updatesEnabled());
    Q_ASSERT(widget->window() == tlw);
    Q_ASSERT(!rgn.isEmpty());

#ifndef QT_NO_GRAPHICSEFFECT
    widget->d_func()->invalidateGraphicsEffectsRecursively();
#endif //QT_NO_GRAPHICSEFFECT

    if (widget->d_func()->paintOnScreen()) {
        if (widget->d_func()->dirty.isEmpty()) {
            widget->d_func()->dirty = rgn;
            sendUpdateRequest(widget, updateImmediately);
            return;
        } else if (qt_region_strictContains(widget->d_func()->dirty, widget->rect())) {
            if (updateImmediately)
                sendUpdateRequest(widget, updateImmediately);
            return; // Already dirty.
        }

        const bool eventAlreadyPosted = !widget->d_func()->dirty.isEmpty();
        widget->d_func()->dirty  = rgn;
        if (!eventAlreadyPosted || updateImmediately)
            sendUpdateRequest(widget, updateImmediately);
        return;
    }

    if (fullUpdatePending) {
        if (updateImmediately)
            sendUpdateRequest(tlw, updateImmediately);
        return;
    }

    if (!windowSurface->hasFeature(QWindowSurface::PartialUpdates)) {
        fullUpdatePending = true;
        sendUpdateRequest(tlw, updateImmediately);
        return;
    }

    const QPoint offset = widget->mapTo(tlw, QPoint());
    const QRect widgetRect = widget->d_func()->effectiveRectFor(widget->rect());
    if (qt_region_strictContains(dirty, widgetRect.translated(offset))) {
        if (updateImmediately)
            sendUpdateRequest(tlw, updateImmediately);
        return; // Already dirty.
    }

    if (invalidateBuffer) {
        const bool eventAlreadyPosted = !dirty.isEmpty();
#ifndef QT_NO_GRAPHICSEFFECT
        if (widget->d_func()->graphicsEffect)
            dirty  = widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset);
        else
#endif //QT_NO_GRAPHICSEFFECT
            dirty  = rgn.translated(offset);
        if (!eventAlreadyPosted || updateImmediately)
            sendUpdateRequest(tlw, updateImmediately);
        return;
    }

    if (dirtyWidgets.isEmpty()) {
        addDirtyWidget(widget, rgn);
        sendUpdateRequest(tlw, updateImmediately);
        return;
    }

    if (widget->d_func()->inDirtyList) {
        if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect)) {
#ifndef QT_NO_GRAPHICSEFFECT
            if (widget->d_func()->graphicsEffect)
                widget->d_func()->dirty  = widget->d_func()->effectiveRectFor(rgn.boundingRect());
            else
#endif //QT_NO_GRAPHICSEFFECT
                widget->d_func()->dirty  = rgn;
        }
    } else {
        addDirtyWidget(widget, rgn);
    }

    if (updateImmediately)
        sendUpdateRequest(tlw, updateImmediately);
}

Marks the region of the widget as dirty (if not already marked as dirty) and posts an UpdateRequest event to the top-level widget (if not already posted).

If updateImmediately is true, the event is sent immediately instead of posted.

If invalidateBuffer is true, all widgets intersecting with the region will be dirty.

If the widget paints directly on screen, the event is sent to the widget instead of the top-level widget, and invalidateBuffer is completely ignored.

static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately)
{
    if (!widget)
        return;
    if (updateImmediately) {
        QEvent event(QEvent::UpdateRequest);
        QApplication::sendEvent(widget, &event);
    } else {
        QApplication::postEvent(widget, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
    }
}


В итоге событие просто помещается в очередь событий UpdateRequest через QApplication::postEvent.

Смотрите также updateGeometry() ,  adjustSize.