ZBLOG

QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::setFont: Painter not active QPainter::setPen: Painter not active QPainter::setFont: Painter not active QPainter::setPen: Painter...

这些警告信息通常是由于在没有有效的绘图设备或者未正确设置画笔和字体的情况下调用了绘图函数而导致的。

关于 QWidget::paintEngine: Should no longer be called 这个警告,它表示不应该再调用 paintEngine() 函数,因为这个函数已经被废弃。这通常发生在使用了过时的绘制代码或者重写了底层绘图引擎的情况下。

至于其他几个警告:

  • QPainter::begin: Paint device returned engine == 0, type: 1 表示没有成功开始绘图操作,可能是因为无效的绘图设备。
  • QPainter::setFont: Painter not activeQPainter::setPen: Painter not active 表示在没有激活 painter 的情况下尝试设置字体或画笔。

要解决这些问题,可以检查以下几点:

  1. 确保你正在正确地创建并使用一个有效的绘图设备(如 QPainter 或 QPaintDevice)。
  2. 在进行绘图之前,确保先调用 begin() 函数来激活 painter。
  3. 如果需要设置字体、画笔等属性,请确保在激活了 painter 后进行设置。

如果仍然存在问题,可以提供更多相关代码以便进一步帮助您分析和解决问题。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=15586

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?