Python Forum

Full Version: print an image using PyQt
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i tried to use QtPrintSupport
it works fine with html content but image doesn't shows up
from PyQt5 import QtPrintSupport

self.editor = QTextEdit(self)
self.editor.setHtml(html_page_var)
dialog = QtPrintSupport.QPrintPreviewDialog()
dialog.paintRequested.connect(self.editor.print_)
dialog.exec_()
i need help
Well if you supply a MRE (Minimal Reproducible Example) of you issue perhaps you can get a quicker answer. I for one have not played around with QtPrintSupport as of yet but without an MRE of you issue I am not even going to take a stab at it as there is not enough to work with. Note if you do not have an MRE that means you are not doing this in a MUC (Minimal Usable Code) which is a mistake in-and-of-itself because when trying to get something to function you need to isolate its functionality and play with it until you get it working before you bring it into the main program you are developing
well it was a silly mistake the code is working just fine
i was typing the wrong image path, silly i know
No not really -- sometimes the most frustrating bugs are simply a typo