QPainter::begin: Paint device returned engine == 0, type: 2

如果出现 “QPainter::begin: Paint device returned engine == 0, type: 2” 的问题

需要检查  QPainter   画布的大小。 

     pixmap 的Size =0,  或者

     pixmap 的Size 过大 都会引起这个问题。


When you get a message from QPainter saying that the engine returned 0, this means that for some reason it is unable to paint on the paint device in question. Pretty much all the times you see this it would be in relation to a QPixmap or a QImage. In the case of QPixmap/QImage it means that it is null, meaning that it has no size set which is why it cannot paint to it. This is either because no size was specified for it or because the size requested was too big that it would have caused an overflow which meant that it ended up not having that size set. If you call isNull() then most of the time it will return true, but sometimes it is possible that QPixmap will not return true but will still have a problem if the size of the pixmap was too large. Reducing the size will make it work.


原文出处 :       http://blog.qt.digia.com/blog/2012/08/03/qt-commercial-support-weekly-23-explaining-the-warningserrors-2/


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值