Unsolved How can I draw an image into TextArea without HTML?
-
QTextEdit can add an image through insertImage,and implement QTextObjectInterface to draw custom object.
But don't work on TextArea. -
@hobbe said in How can I draw an image into TextArea without HTML?:
But don't work on TextArea.
about what TextArea are you talking exactly? You mean inside a QWebEngineView?
-
@raven-worx
I assumed he meant https://doc.qt.io/qt-5/qml-qtquick-controls-textarea.html, since we're in a QML forum. -
@JonB
oh yea... of course.Then no. You have access to it's QTextDocument, but its not allowed to be modified
-
@raven-worx I didn‘t know there were classes one isn‘t supposed to modfy, look at that...
Since this is in qml, you could simply add an Image element on top of your textarea,
it will require a good amount of micro managment, aligning, show not to show logic etc. but should be possible. -
@J.Hilk said in How can I draw an image into TextArea without HTML?:
@raven-worx I didn‘t know there were classes one isn‘t supposed to modfy, look at that...
Since this is in qml, you could simply add an Image element on top of your textarea,
it will require a good amount of micro managment, aligning, show not to show logic etc. but should be possible.I'm now drawing image on top of textarea,but the performance is very bad(will cause the textedit blink).
My solution is to draw image on QImage and then create an texturenode add into TextNode.but draw QImage is low performance,is a way can draw image to the texture directly by opengl?