QPainter::begin: Paint device returned engine == 0, type: 2
2016-04-25 11:38
627 查看
如果出现 “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/
需要检查 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/
相关文章推荐
- centos7 Unit https.service failed to load: No such file or directory.
- 机器学习算法之朴素贝叶斯(Naive Bayes)--第一篇
- failed to get the task for process XXX(解决方案)
- Window 对象详解 转自 http://blog.csdn.net/jcx5083761/article/details/41243697
- [REP]AWS Regions and Availability Zones: the simplest explanation you will ever find around
- Naive Bayes
- Magento SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_pack
- 设计模式读书笔记之职责链模式(chain of responsibility)
- 浅谈特定型人工智能设计
- Detailed Singleton pattern
- 220. Contains Duplicate III
- Exception in thread "main" org.hibernate.TypeMismatchException: Provided id of the wrong type
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
- VirtualBox Host-only Adapter,Failed to create the host-only adapter
- 如何查看AOPR中的Outlook Mail信息
- TurboMail邮件服务器攻略:如何有效防止邮箱被盗用
- USACO TRAINING - PROB Broken Necklace
- MyBaits 错误分析
- opencv_traincascade训练haar时Error: Insufficient memory等问题