首页| 论坛| 消息

回复: 111
#6 [msccreater 10-30 09:54]
我比较在意楼主用的什么系统?感觉很好看
#7 回 msccreater 的帖子 [rekols 10-30 10:01]
msccreater:我比较在意楼主用的什么系统?感觉很好看 (2017-10-30 09:54) 
deepin.org
#8 回 liudianwu 的帖子 [stlcours 10-30 16:30]
liudianwu:用 repaint();很容易引起崩溃的,尤其是频繁刷新界面的情况下,基本上不建议用 repaint();,建议用update(); (2017-10-29 19:52) 
原理是啥?照理说,update是直接调用刷新函数,太忙的时候,才容易崩溃。为什么反而是repaint有这个问题?
#9 回 stlcours 的帖子 [liudianwu 10-30 17:12]
stlcours:原理是啥?照理说,update是直接调用刷新函数,太忙的时候,才容易崩溃。为什么反而是repaint有这个问题? (2017-10-30 16:30) 
repaint是强制刷新,不管死活的,update是放入事件队列,让qt事件机制去处理。repaint频率过高很容易崩掉的。可自行看qt帮助文档!
#10 回 liudianwu 的帖子 [stlcours 10-30 19:24]
liudianwu:repaint是强制刷新,不管死活的,update是放入事件队列,让qt事件机制去处理。repaint频率过高很容易崩掉的。可自行看qt帮助文档! (2017-10-30 17:12) 
看了,与你说的正好相反:
void QWidget::repaint()
Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden.
We suggest only using repaint() if you need an immediate repaint, for example during animation. In almost all circumstances update() is better, as it permits Qt to optimize for speed and minimize flicker.
Warning: If you call repaint() in a function which may itself be called from paintEvent(), you may get infinite recursion. The update() function never causes recursion.
http://doc.qt.io/qt-5/qwidget.html#repaint

<< 1 2 3 4 >> (2/4)

回复 发表
主题 版块