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

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

tsql - Correct sql/hql query (aggregate in where clause) -