void QWidget::update ()分析重绘事件激活 1看看手册中这段话
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().
2.update() 激发Paint Event 事件的发生,而Paint Event 时间将调用QWidegt::PaintEvent(QPaintEvent paint)
而这个Protected函数是定义窗口自己的绘制特性。
3.void QWidget::update () [槽]
更新窗口部件,除非更新已经失效或者窗口部件被隐藏。
这个函数不会导致一个立刻的重新绘制——更正确的是,当Qt回到主事件回路中时,它规划了所要处理的绘制事件。这样允许Qt来优化得到比调用repaint()更快的速度和更少的闪烁。
几次调用update()的结果通常仅仅是一次paintEvent()调用。
Qt通常在paintEvent()调用之前擦除这个窗口部件的区域。仅仅只有在WRepaintNoErase窗口部件标记被设置的时候,窗口部件本身对绘制它所有的像素负有责任。

转:https://www.cnblogs.com/hnrainll/archive/2011/05/26/2057766.html

总之:update会调用PaintEvent,往往PaintEvent是子类重新定义的

最新文章

  1. Oracle数据库该如何着手优化一个SQL
  2. iOS 编码转换
  3. 学习地址(oraclemysqllinux)
  4. 庆祝下:iOS 开发者企业级计划(299美元/年帐户+邓白氏码免费) 和 Windows Phone公司应用(公司帐户99美元+Symantec企业证书299美元/年))顺利发布成功
  5. Android之TextView文字绘制流程
  6. MySQL InnoDB数据库备份与还原
  7. UESTC 1591 An easy problem A【线段树点更新裸题】
  8. JS动态添加行列
  9. JavaScript 延迟加载
  10. AI-restful接口写法
  11. mpvue 解析
  12. 如何开始DDD(续)
  13. mycat学习笔记
  14. 探求C#.Net中ArrayList与Array的区别
  15. Apache关闭VirtualHost的Log日志记录
  16. Linux CentOS7系统中mysql8安装配置
  17. Microsoft SQL Server on Linux破解 2G内存限制
  18. Android Studio如何用真机调试
  19. Http协议面试题
  20. Vim练级攻略(转)

热门文章

  1. P2P system:How Chord tackles failures
  2. Java并发包--ConcurrentHashMap原理解析
  3. @EnableCircuitBreaker熔断超时机制
  4. 使用bootstrap的栅格布局,用row后出现横向滚动条
  5. CF277B Set of Points——构造题
  6. AirtestIde的安装(win10)
  7. k8s aliyun mirros
  8. Vagrant Docker Composer Yarn 国外资源下载慢或失败的问题
  9. 057_统计 Linux 进程相关数量信息
  10. jsp中submit的连接属性是什么?