About using of QPrint and QPrintDialog
m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData)
m (Hamishwillee - Addition to article of: Category:MeeGo Category:Symbian. (Add platform categories))
|Line 39:||Line 39:|
Revision as of 08:53, 15 February 2012
The QPrinter class is responsible for printing in Qt. Like QPixmap or QImage, it is a QPaintDevice. There is also the QPrintDialog class, enabling a variety of settings to be made at the printer. Under Windows and Mac OS X the class shows the print dialog of the system; otherwise, it uses a separate dialog. The user can manipulate all the settings in the dialog. But user must keep in mind some basic information while using these classes in the code.
It is better to predefine QPrinter and QPrintDialog before using them inside the code or else compilation process will not be successful because of no printer support.
QPrintDialog dialog(&printer, this);