• 12583阅读
  • 4回复

【提问】update()与paintEvent(NULL)有什么区别? [复制链接]

上一主题 下一主题
离线avacool
 
只看楼主 倒序阅读 楼主  发表于: 2005-11-11
如题
离线avacool
只看该作者 1楼 发表于: 2005-11-11
我是说在类的内部调用这两个函数的时候
离线mudfish
只看该作者 2楼 发表于: 2005-11-14
看看手册中这段话
void QWidget::update () [slot]
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().
离线paul
只看该作者 3楼 发表于: 2005-11-15
update() 激发Paint Event 事件的发生,而Paint Event 时间将调用QWidegt::PaintEvent(QPaintEvent paint)
而这个Protected函数是定义窗口自己的绘制特性。
离线youngki
只看该作者 4楼 发表于: 2005-11-15
应该问update()与repaint()有什么区别吧,
手册中也有
知识和财富,只在流通中产生价值
快速回复
限100 字节
 
上一个 下一个