首页| 论坛| 消息

标题:【提问】update()与paintEvent(NULL)有什么区别?
作者:avacool
日期:2005-11-11 17:03
内容:

如题


#1 [avacool 11-11 17:28]
我是说在类的内部调用这两个函数的时候
#2 [mudfish 11-14 14:16]
看看手册中这段话
void QWidget::update ()
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 WRepaintNoErase widget flag is set, the widget is responsible for painting all its pixels itself.
See also repaint(), paintEvent(), updatesEnabled, erase(), and setWFlags().
#3 [paul 11-15 12:23]
update()激发Paint Event 事件的发生,而Paint Event 时间将调用QWidegt::PaintEvent(QPaintEvent paint)
而这个Protected函数是定义窗口自己的绘制特性。
#4 [youngki 11-15 13:21]
应该问update()与repaint()有什么区别吧,
手册中也有

回复 发表
主题 版块