Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

About using of QPrint and QPrintDialog

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Emulator / desktop / device
Compatibility
Platform(s): All Qt Supported
Symbian
Article
Keywords: QPrint, QPrintDialog
Created: r60600 (28 Nov 2010)
Last edited: hamishwillee (11 Oct 2012)


Overview

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.


Tips

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.

#ifndef QT_NO_PRINTER
 
...
 
QPrinter printer(QPrinter::HighResolution);
 
QPrintDialog dialog(&printer, this);
 
...
 
#endif
This page was last modified on 11 October 2012, at 01:15.
77 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×