• 7852阅读
  • 3回复

为什么mouseMoveEvent会触发paintEvent? [复制链接]

上一主题 下一主题
离线sywh
 

只看楼主 倒序阅读 楼主  发表于: 2014-06-04
为什么mouseMoveEvent会触发paintEvent?然后会一直引起重绘,如果我不想让mouseMoveEvent引起重绘,需要怎么处理?
fighting &&
离线toby520

只看该作者 1楼 发表于: 2014-06-04
不触发paintevent就不要重写它 我想应该不会重绘
QtQML多多指教开发社区 http://qtclub.heilqt.com
将QtCoding进行到底
关注移动互联网,关注金融
开发跨平台客户端,服务于金融行业
专业定制界面
群号:312125701   373955953(qml控件定做)
离线toby520

只看该作者 2楼 发表于: 2014-06-04
A paint event is a request to repaint all or part of a widget. It can happen for one of the following reasons:

repaint() or update() was invoked,
the widget was obscured and has now been uncovered, or
many other reasons.
QtQML多多指教开发社区 http://qtclub.heilqt.com
将QtCoding进行到底
关注移动互联网,关注金融
开发跨平台客户端,服务于金融行业
专业定制界面
群号:312125701   373955953(qml控件定做)
离线_jason

只看该作者 3楼 发表于: 2014-06-19
setUpdatesEnabled(TRUE);
    update();
setUpdatesEnabled(FALSE);
在需要重绘的时候要这两个函数,update之后会设置为False,其他事件就不会触发重绘了
默默地努力,从未被超越
快速回复
限100 字节
 
上一个 下一个