×
Namespaces

Variants
Actions
(Difference between revisions)

About using of QPrint and QPrintDialog

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Text replace - "Category:MeeGo" to "Category:MeeGo Harmattan")
hamishwillee (Talk | contribs)
m (Text replace - "<code cpp>" to "<code cpp-qt>")
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
[[Category:Qt]]
 
[[Category:Qt]]
{{ArticleMetaData
+
{{ArticleMetaData <!-- v1.2 -->
|id=
+
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
|platform= All Qt Supported
+
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|devices= Emulator / desktop / device
 
|devices= Emulator / desktop / device
|category=Qt
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|platform= All Qt Supported
 +
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= QPrint, QPrintDialog
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 28 November 2010
 +
|author= [[User:R60600]]
 +
<!-- The following are not in current metadata -->
 
|subcategory= QPaintDevice
 
|subcategory= QPaintDevice
|creationdate=28 November 2010
 
|keywords=QPrint, QPrintDialog
 
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
 
|author=[[User:R60600]]
 
 
}}
 
}}
  
Line 25: Line 32:
 
== Tips ==
 
== Tips ==
  
It is better to predefine {{Icode|QPrinter}}  and {{Icode|QPrintDialog}} before using them inside the code or else compilation process will not be successful because of no printer support.
+
It is better to predefine {{Icode|QPrinter}}  and {{Icode|QPrintDialog}} before using them inside the code or else compilation process will not be successful because of no printer support.
<code cpp>
+
<code cpp-qt>
 
#ifndef QT_NO_PRINTER
 
#ifndef QT_NO_PRINTER
  

Latest revision as of 04:15, 11 October 2012

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)


[edit] 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.


[edit] 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 04:15.
65 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.

×