2025年qpainter 绘制图片(qpainter绘制文字)

qpainter 绘制图片(qpainter绘制文字)印象中只有 UI 线程能绘制 如果怀疑是字符集的原因 你把这些字符集换成英文字符试试 英文字符的话不同字符集下都能正常显示 如果怀疑是编译器的原因 你可以换到其他环境的编译器来编译 排除一下猜想 Font rendering on background threads can be a little flaky in Qt depending on how it was compiled

大家好,我是讯享网,很高兴认识大家。



印象中只有UI线程能绘制,如果怀疑是字符集的原因,你把这些字符集换成英文字符试试,英文字符的话不同字符集下都能正常显示。
如果怀疑是编译器的原因,你可以换到其他环境的编译器来编译,排除一下猜想。

Font rendering on background threads can be a little flaky in Qt, depending on how it was compiled. Check the value of QFontDatabase::supportsThreadedFontRendering on your system.

Note the documentation:
Returns true if font rendering is supported outside the GUI thread, false otherwise. In other words, a return value of false means that all QPainter::drawText() calls outside the GUI thread will not produce readable output.
然后我分别在Windows和Linux下调试了下返回值。一个返回true一个返回false,感觉麻烦大了。

讯享网

小讯
上一篇 2025-04-20 10:10
下一篇 2025-05-09 10:21

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/157682.html