[190] | 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"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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
|
---|
| 35 | paint device.
|
---|
| 36 | <a href="#details">More...</a>
|
---|
| 37 | <p><tt>#include <<a href="qpaintdevicemetrics-h.html">qpaintdevicemetrics.h</a>></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 QPaintDevice * 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 |
|
---|
| 54 | The QPaintDeviceMetrics class provides information about a
|
---|
| 55 | paint device.
|
---|
| 56 | <p>
|
---|
| 57 |
|
---|
| 58 | <p> Sometimes when drawing graphics it is necessary to obtain
|
---|
| 59 | information about the physical characteristics of a paint device.
|
---|
| 60 | This class provides the information. For example, to compute the
|
---|
| 61 | aspect 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
|
---|
| 68 | height of a device in both pixels (<a href="#width">width</a>() and <a href="#height">height</a>()) and
|
---|
| 69 | millimeters (<a href="#widthMM">widthMM</a>() and <a href="#heightMM">heightMM</a>()), the number of colors the
|
---|
| 70 | device supports (<a href="#numColors">numColors</a>()), the number of bit planes (<a href="#depth">depth</a>()),
|
---|
| 71 | and 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
|
---|
| 74 | values you ask for, particularly for external devices. The
|
---|
| 75 | ultimate example is asking for the resolution of of a <a href="qprinter.html">QPrinter</a>
|
---|
| 76 | that is set to "print to file": who knows what printer that file
|
---|
| 77 | will 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 <a href="qpaintdevice.html">QPaintDevice</a> * pd )
|
---|
| 82 | </h3>
|
---|
| 83 | Constructs 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
|
---|
| 94 | system 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,
|
---|
| 106 | which is used when computing font sizes. For X, this is usually
|
---|
| 107 | the same as could be computed from <a href="#widthMM">widthMM</a>(), but it varies on
|
---|
| 108 | Windows.
|
---|
| 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,
|
---|
| 115 | which is used when computing font sizes. For X, this is usually
|
---|
| 116 | the same as could be computed from <a href="#heightMM">heightMM</a>(), but it varies on
|
---|
| 117 | Windows.
|
---|
| 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
|
---|
| 124 | device. Since this value is an int will not be sufficient to represent
|
---|
| 125 | the number of colors on 32 bit displays, in which case INT_MAX is
|
---|
| 126 | returned 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
|
---|
| 132 | units (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>
|
---|
| 142 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 143 | Copyright © 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 © 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>
|
---|