你可以看一看QT中QWidget::repaint的实现.
如QT3.12中:
void QWidget::repaint( const QRegion& reg, bool erase )
{
if ( (widget_state & (WState_Visible|WState_BlockUpdates)) == WState_Visible && isVisible() ) {
if ( erase )
this->erase(reg);
QPaintEvent e( reg, erase );
qt_set_paintevent_clipping( this, reg );
QApplication::sendEvent( this, &e );
qt_clear_paintevent_clipping();
}
}