Answer the question
In order to leave comments, you need to log in
How to insert image in QTextEdit
I'm making a small text editor, but I have a problem: I can't insert an image into QTextEdit. Tried to embed using html tag like this:
def insertImage():
filePath = QtGui.QFileDialog.getOpenFileName(
None,
"Select an image",
".",
"Image Files(*.png *.gif *.jpg *jpeg *.bmp)"
)
if filePath:
window.textarea.insertHtml('<img scr="{0}">' .format(filePath) )
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question