source: trunk/doc/html/qpaintdevicemetrics.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 7.5 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qpaintdevicemetrics.cpp:40 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QPaintDeviceMetrics Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QPaintDeviceMetrics Class Reference</h1>
33
34<p>The QPaintDeviceMetrics class provides information about a
35paint device.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qpaintdevicemetrics-h.html">qpaintdevicemetrics.h</a>&gt;</tt>
38<p><a href="qpaintdevicemetrics-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QPaintDeviceMetrics"><b>QPaintDeviceMetrics</b></a> ( const&nbsp;QPaintDevice&nbsp;*&nbsp;pd )</li>
42<li class=fn>int <a href="#width"><b>width</b></a> () const</li>
43<li class=fn>int <a href="#height"><b>height</b></a> () const</li>
44<li class=fn>int <a href="#widthMM"><b>widthMM</b></a> () const</li>
45<li class=fn>int <a href="#heightMM"><b>heightMM</b></a> () const</li>
46<li class=fn>int <a href="#logicalDpiX"><b>logicalDpiX</b></a> () const</li>
47<li class=fn>int <a href="#logicalDpiY"><b>logicalDpiY</b></a> () const</li>
48<li class=fn>int <a href="#numColors"><b>numColors</b></a> () const</li>
49<li class=fn>int <a href="#depth"><b>depth</b></a> () const</li>
50</ul>
51<hr><a name="details"></a><h2>Detailed Description</h2>
52
53
54The QPaintDeviceMetrics class provides information about a
55paint device.
56<p>
57
58<p> Sometimes when drawing graphics it is necessary to obtain
59information about the physical characteristics of a paint device.
60This class provides the information. For example, to compute the
61aspect ratio of a paint device:
62<p> <pre>
63 QPaintDeviceMetrics pdm( myWidget );
64 double aspect = (double)pdm.<a href="#widthMM">widthMM</a>() / (double)pdm.<a href="#heightMM">heightMM</a>();
65 </pre>
66
67<p> QPaintDeviceMetrics contains methods to provide the width and
68height of a device in both pixels (<a href="#width">width</a>() and <a href="#height">height</a>()) and
69millimeters (<a href="#widthMM">widthMM</a>() and <a href="#heightMM">heightMM</a>()), the number of colors the
70device supports (<a href="#numColors">numColors</a>()), the number of bit planes (<a href="#depth">depth</a>()),
71and the resolution of the device (<a href="#logicalDpiX">logicalDpiX</a>() and
72<a href="#logicalDpiY">logicalDpiY</a>()).
73<p> It is not always possible for QPaintDeviceMetrics to compute the
74values you ask for, particularly for external devices. The
75ultimate example is asking for the resolution of of a <a href="qprinter.html">QPrinter</a>
76that is set to "print to file": who knows what printer that file
77will end up on?
78<p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.
79
80<hr><h2>Member Function Documentation</h2>
81<h3 class=fn><a name="QPaintDeviceMetrics"></a>QPaintDeviceMetrics::QPaintDeviceMetrics ( const&nbsp;<a href="qpaintdevice.html">QPaintDevice</a>&nbsp;*&nbsp;pd )
82</h3>
83Constructs a metric for the paint device <em>pd</em>.
84
85<h3 class=fn>int <a name="depth"></a>QPaintDeviceMetrics::depth () const
86</h3>
87
88<p> Returns the bit depth (number of bit planes) of the paint device.
89
90<h3 class=fn>int <a name="height"></a>QPaintDeviceMetrics::height () const
91</h3>
92
93<p> Returns the height of the paint device in default coordinate
94system units (e.g. pixels for <a href="qpixmap.html">QPixmap</a> and <a href="qwidget.html">QWidget</a>).
95
96<p>Examples: <a href="qaction-application-example.html#x1141">action/application.cpp</a>, <a href="simple-application-example.html#x1559">application/application.cpp</a>, <a href="helpviewer-example.html#x996">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2040">mdi/application.cpp</a>, and <a href="qwerty-example.html#x378">qwerty/qwerty.cpp</a>.
97<h3 class=fn>int <a name="heightMM"></a>QPaintDeviceMetrics::heightMM () const
98</h3>
99
100<p> Returns the height of the paint device, measured in millimeters.
101
102<h3 class=fn>int <a name="logicalDpiX"></a>QPaintDeviceMetrics::logicalDpiX () const
103</h3>
104
105<p> Returns the horizontal resolution of the device in dots per inch,
106which is used when computing font sizes. For X, this is usually
107the same as could be computed from <a href="#widthMM">widthMM</a>(), but it varies on
108Windows.
109
110<p>Example: <a href="qwerty-example.html#x379">qwerty/qwerty.cpp</a>.
111<h3 class=fn>int <a name="logicalDpiY"></a>QPaintDeviceMetrics::logicalDpiY () const
112</h3>
113
114<p> Returns the vertical resolution of the device in dots per inch,
115which is used when computing font sizes. For X, this is usually
116the same as could be computed from <a href="#heightMM">heightMM</a>(), but it varies on
117Windows.
118
119<p>Examples: <a href="qaction-application-example.html#x1142">action/application.cpp</a>, <a href="simple-application-example.html#x1560">application/application.cpp</a>, <a href="helpviewer-example.html#x997">helpviewer/helpwindow.cpp</a>, and <a href="mdi-example.html#x2041">mdi/application.cpp</a>.
120<h3 class=fn>int <a name="numColors"></a>QPaintDeviceMetrics::numColors () const
121</h3>
122
123<p> Returns the number of different colors available for the paint
124device. Since this value is an int will not be sufficient to represent
125the number of colors on 32 bit displays, in which case INT_MAX is
126returned instead.
127
128<h3 class=fn>int <a name="width"></a>QPaintDeviceMetrics::width () const
129</h3>
130
131<p> Returns the width of the paint device in default coordinate system
132units (e.g. pixels for <a href="qpixmap.html">QPixmap</a> and <a href="qwidget.html">QWidget</a>).
133
134<p>Examples: <a href="qaction-application-example.html#x1143">action/application.cpp</a>, <a href="simple-application-example.html#x1561">application/application.cpp</a>, <a href="helpviewer-example.html#x998">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2042">mdi/application.cpp</a>, and <a href="qwerty-example.html#x380">qwerty/qwerty.cpp</a>.
135<h3 class=fn>int <a name="widthMM"></a>QPaintDeviceMetrics::widthMM () const
136</h3>
137
138<p> Returns the width of the paint device, measured in millimeters.
139
140<!-- eof -->
141<hr><p>
142This file is part of the <a href="index.html">Qt toolkit</a>.
143Copyright &copy; 1995-2007
144<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
145<table width=100% cellspacing=0 border=0><tr>
146<td>Copyright &copy; 2007
147<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
148<td align=right><div align=right>Qt 3.3.8</div>
149</table></div></address></body>
150</html>
Note: See TracBrowser for help on using the repository browser.