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

asp.net - Change the driver in the connection string to a data source in VB.Net -

Getting started consuming web services in a Ruby on Rails 3 application -

objective c - iPhone and it's wireless area -