QT painting rich text on QGraphicsScene

I am writing very simple vector tool for graphics. I have rich text edited in QTextEditor. I also have class extending QGraphicsScene where all my drawings are. I want to somehow paint text from QTextEditor on this scene? What are my options?

Best Regards!


You can use QPainter::drawtext() method. basically you get a painter of the area you want to draw in and then use this method to draw your text.

 QPainter p(this);
 p.drawText(rect(), Qt::AlignCenter, "Hello World!");
链接地址: http://www.djcxy.com/p/49676.html

上一篇: QTextEdit和光标交互

下一篇: QT在QGraphicsScene上绘制丰富的文字