Qt QWidget::paintEngine: Should no longer be called 错误的解决办法
2014-02-10 14:42
399 查看
今天在重写QListView的 paintEvent方法时
运行时遇到了如下问题(并且文字并没有显示):
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
其解决思路是:
将QPainter painter(this);这一句改成QPainter painter(this->viewport());
我的问题就解决了
QPainterpainter(this);
painter.drawText(rect(),Qt::AlignCenter,tr("Draganddropfile(s)here"));
运行时遇到了如下问题(并且文字并没有显示):
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
其解决思路是:
将QPainter painter(this);这一句改成QPainter painter(this->viewport());
我的问题就解决了
相关文章推荐
- 自学QT之QWidget::paintEngine: Should no longer be called的解决办法
- Unable to paint on Qt Widget, shows error “paintEngine: Should no longer be called”
- QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0
- QWidget::paintEngine: Should no longer be called
- QWidget::paintEngines:should no longer be called.
- php 错误 Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of 解决办法
- azkaban-web-start.sh启动时出现Table 'execution_flows' is marked as crashed and should be repaired Query错误的解决办法(图文详解)
- -[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread.【创建键盘监听事件,然后操作键盘(弹出、收回),结果在运行程序时出现如下错误(如有知道解决办法的朋友请留言探讨!)】
- No JVM could be found on your system错误的解决办法
- Entity Framework 中 使用Include 解决ObjectContext instance has been disposed and can no longer be used for operations that require a connection错误 -原创
- opencv中关于图像图像处理时出现Bad argument (Array should be the cvMat or IplImage) in unknown function ……错误的解决办法
- 使用screen恢复会话时出现There is no screen to be resumed matching错误解决办法
- python错误:ImportError: No module named setuptools解决办法
- 我的Java开发学习之旅------>Workspace in use or cannot be created, choose a different one.--错误解决办法
- CentOS 出现no space left on device错误解决办法
- Qt5编译时出现<QtGui/QApplication> ---> No such file or directory错误解决办法
- iphone No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv6 armv7)错误解决办法
- Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer错误解决办法
- asp + Access 常见的数据库访问失败问题 Microsoft JET Database Engine 错误 '80004005' 解决办法
- Android中cannot be resolved or is not a field错误的解决办法