Qt 问题记录

问题记录

运行时出现的问题

运行出现的warning

QWidget::repaint: Recursive repaint detected

在paintEvent中使用painter绘制了线段、图片,移动了QWidget,加入了下面代码导致的

QApplication::processEvents();

屏蔽后没有出现该warning

QApplication::processEvents();

	Processes all pending events for the calling thread according to the specified flags until there are no more events to process.
	You can call this function occasionally when your program is busy performing a long operation (e.g. copying a file).
In the event that you are running a local loop which calls this function continuously, without an event loop, the DeferredDelete events will not be processed.  
  This can affect the behaviour of widgets, e.g. QToolTip, that rely on DeferredDelete events to function properly. An alternative would be to call sendPostedEvents() from within that local loop.
Calling this function processes events only for the calling thread.	
	根据指定的标志处理调用线程的所有挂起事件,直到没有更多的事件要处理为止。
	当程序忙于执行长操作(例如,复制文件)时,您可以偶尔调用此函数。
	如果您正在运行一个连续调用此函数的本地循环,而没有事件循环,则不会处理DeferredDelete事件。这可能会影响依赖DeferredDelete事件正常工作的小部件(如QToolTip)的行为。另一种选择是从本地循环中调用sendPostedEvents()。
调用此函数只处理调用线程的事件。
  • 10
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值