QPainter::setFont: Painter not active和 QPainter::setPen: Painter not active
来源:互联网 发布:中级会计师网校 知乎 编辑:程序博客网 时间:2024/06/14 17:51
运用想要使用QPainter绘图时,运行时出现如上所示错误,原因如下:
因为QT不像MFC在什么时间都可以绘图,使用QPainter画图,就要继承QWidget,重写paintEvent()虚函数,在里面进行绘图。
如果要在其他地方绘制图形,可以考虑绘制到QImage或者QPixmap上面,然后在paintEvent()里面调用QPainter的绘制图像的函数。
1 0
- QPainter::setFont: Painter not active和 QPainter::setPen: Painter not active
- QPainter::setPen: Painter not active问题解决
- Painter not active
- qt error: variable `QPainter painter' has initializer but incomplete type
- Qt QPainter::end: Painter ended whith 2 saced states
- QPainter
- QPainter
- QPainter
- QPainter
- QPainter
- QPainter
- QPainter
- Painter
- Painter
- ORA-21779: duration not active
- This device is not active
- The transaction is not active!解决方案
- ORA-21779: duration not active问题处理
- Android——Fragment(碎片)的动态加载方式....
- 前端性能优化----yahoo前端性能团队总结的35条黄金定律
- 《权限控制系列2》------防止用户跳过登录页面和Session时长问题
- UDP通信socket编程
- PLSQL连接远程仓库的配置
- QPainter::setFont: Painter not active和 QPainter::setPen: Painter not active
- 画板实现小案例
- 配置spring事务管理的几种方式(声明式事务)----使用tx标签配置的拦截器
- Java基础(三) Java变量、操作符及判断和循环语句之(二)
- BZOJ 1257: [CQOI2007]余数之和sum [分块]【数学】
- jquery拖拽方块效果
- opencv之分水岭算法watershed源码注释
- 阿里巴巴Java开发手册(开发规范)(节选)
- 堆相关