QT在QGraphicsScene上绘制富文本
QT painting rich text on QGraphicsScene
我正在为图形编写非常简单的矢量工具。我有QTextEditor
编辑的富文本。我也有类扩展QGraphicsScene
我所有的图纸在哪里。我想以某种方式在这个场景中绘制QTextEditor
的文本?我有哪些选择?
此致敬意!
您可以使用QPainter::drawtext()
方法。 基本上,你会得到一个你想要绘制的区域的画家,然后使用这种方法来绘制你的文本。
QPainter p(this);
p.drawText(rect(), Qt::AlignCenter, "Hello World!");
相关文章:
- SFML 文本未绘制在窗口上
- QPainter 将 QBrush 设置为 在 QT/C++ 中绘制文本
- 绘制文本问题
- SFML 2.4.2 - 绘制文本时出现分段错误
- 在 Qt C++ 中在自定义项委托上绘制文本时的性能问题
- QTool按钮上的文本未绘制
- 如何在透视视图中绘制文本
- Qt:用不同的字体绘制文本
- Linux绘制文本模式(无GUI,桌面)
- 如何在MFC中一一绘制单独的文本
- 使用Glstipple时,Oglft绘制文本
- 绘制文本和文本剪辑
- 有效地在 QPainterPath 周围绘制文本
- DirectWrite GDI 互操作:使用"IDWriteFontFace"绘制文本的简单方法
- 如何从文本中绘制这些数据
- DrawStatustext仅在后续呼叫上不在第一次呼叫上绘制文本
- SFML 在绘制文本时崩溃
- QPainter 未正确绘制文本
- 将文本绘制到屏幕
- 如何使用 WinAPI 将文本绘制到字节数组