关于update() qt给出的说明有这样一句 This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop.
而repaint() 是这样的。Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden.
所以用update有时候不会立刻显示