html - Python Qt: Qprinter not defined -


I am trying to run the printer output from the HTML document.

Here's one small function to do this:

  def callPrinterHtml (auto, document): self.printer = QPrinter () self.printer.setPageSize (QPrinter. Letter dialog = QPrintDialog (self.printer, self) if dialog.exec_ (): document.print_ (self.printer)  

Although the message is pop up:

  self.printer = QPrinter () Name Error: Global Name 'QPrinter' is not defined  

The printer is clearly inside the definition definition function. So, what am I missing here?

All comments and suggestions are highly appreciated.

  1. Did you import the module that contains the QPrinter? Using an Import Directive?

  2. Is the QPrinter containing the module in your dragon path?


Comments

Popular posts from this blog

c# - TypeConverter in propertygrid only converts from string, not to -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -