qpaintdevicemetrics.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 149 行

HTML
149
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qpaintdevicemetrics.cpp:40 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QPaintDeviceMetrics Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><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><p>The QPaintDeviceMetrics class provides information about apaint device.<a href="#details">More...</a><p><tt>#include &lt;<a href="qpaintdevicemetrics-h.html">qpaintdevicemetrics.h</a>&gt;</tt><p><a href="qpaintdevicemetrics-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QPaintDeviceMetrics"><b>QPaintDeviceMetrics</b></a> ( const&nbsp;QPaintDevice&nbsp;*&nbsp;pd )</div></li><li><div class=fn>int <a href="#width"><b>width</b></a> () const</div></li><li><div class=fn>int <a href="#height"><b>height</b></a> () const</div></li><li><div class=fn>int <a href="#widthMM"><b>widthMM</b></a> () const</div></li><li><div class=fn>int <a href="#heightMM"><b>heightMM</b></a> () const</div></li><li><div class=fn>int <a href="#logicalDpiX"><b>logicalDpiX</b></a> () const</div></li><li><div class=fn>int <a href="#logicalDpiY"><b>logicalDpiY</b></a> () const</div></li><li><div class=fn>int <a href="#numColors"><b>numColors</b></a> () const</div></li><li><div class=fn>int <a href="#depth"><b>depth</b></a> () const</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QPaintDeviceMetrics class provides information about apaint device.<p> <p> Sometimes when drawing graphics it is necessary to obtaininformation about the physical characteristics of a paint device.This class provides the information. For example, to compute theaspect ratio of a paint device:<p> <pre>        QPaintDeviceMetrics pdm( myWidget );        double aspect = (double)pdm.<a href="#widthMM">widthMM</a>() / (double)pdm.<a href="#heightMM">heightMM</a>();    </pre> <p> QPaintDeviceMetrics contains methods to provide the width andheight of a device in both pixels (<a href="#width">width</a>() and <a href="#height">height</a>()) andmillimeters (<a href="#widthMM">widthMM</a>() and <a href="#heightMM">heightMM</a>()), the number of colors thedevice supports (<a href="#numColors">numColors</a>()), the number of bit planes (<a href="#depth">depth</a>()),and the resolution of the device (<a href="#logicalDpiX">logicalDpiX</a>() and<a href="#logicalDpiY">logicalDpiY</a>()).<p> It is not always possible for QPaintDeviceMetrics to compute thevalues you ask for, particularly for external devices. Theultimate example is asking for the resolution of of a <a href="qprinter.html">QPrinter</a>that is set to "print to file": who knows what printer that filewill end up on?<p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QPaintDeviceMetrics"></a>QPaintDeviceMetrics::QPaintDeviceMetrics ( const&nbsp;<a href="qpaintdevice.html">QPaintDevice</a>&nbsp;*&nbsp;pd )</h3>Constructs a metric for the paint device <em>pd</em>.<h3 class=fn>int <a name="depth"></a>QPaintDeviceMetrics::depth () const</h3><p> Returns the bit depth (number of bit planes) of the paint device.<h3 class=fn>int <a name="height"></a>QPaintDeviceMetrics::height () const</h3><p> Returns the height of the paint device in default coordinatesystem units (e.g. pixels for <a href="qpixmap.html">QPixmap</a> and <a href="qwidget.html">QWidget</a>).<p>Examples: <a href="qaction-application-example.html#x1078">action/application.cpp</a>, <a href="simple-application-example.html#x1523">application/application.cpp</a>, <a href="helpviewer-example.html#x997">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2024">mdi/application.cpp</a> and <a href="qwerty-example.html#x376">qwerty/qwerty.cpp</a>.<h3 class=fn>int <a name="heightMM"></a>QPaintDeviceMetrics::heightMM () const</h3><p> Returns the height of the paint device, measured in millimeters.<h3 class=fn>int <a name="logicalDpiX"></a>QPaintDeviceMetrics::logicalDpiX () const</h3><p> Returns the horizontal resolution of the device in dots per inch,which is used when computing font sizes. For X, this is usuallythe same as could be computed from <a href="#widthMM">widthMM</a>(), but it varies onWindows.<p>Examples: <a href="helpviewer-example.html#x998">helpviewer/helpwindow.cpp</a> and <a href="qwerty-example.html#x377">qwerty/qwerty.cpp</a>.<h3 class=fn>int <a name="logicalDpiY"></a>QPaintDeviceMetrics::logicalDpiY () const</h3><p> Returns the vertical resolution of the device in dots per inch,which is used when computing font sizes. For X, this is usuallythe same as could be computed from <a href="#heightMM">heightMM</a>(), but it varies onWindows.<p>Example: <a href="helpviewer-example.html#x999">helpviewer/helpwindow.cpp</a>.<h3 class=fn>int <a name="numColors"></a>QPaintDeviceMetrics::numColors () const</h3><p> Returns the number of different colors available for the paintdevice.<h3 class=fn>int <a name="width"></a>QPaintDeviceMetrics::width () const</h3><p> Returns the width of the paint device in default coordinate systemunits (e.g. pixels for <a href="qpixmap.html">QPixmap</a> and <a href="qwidget.html">QWidget</a>).<p>Examples: <a href="qaction-application-example.html#x1079">action/application.cpp</a>, <a href="simple-application-example.html#x1524">application/application.cpp</a>, <a href="helpviewer-example.html#x1000">helpviewer/helpwindow.cpp</a>, <a href="mdi-example.html#x2025">mdi/application.cpp</a> and <a href="qwerty-example.html#x378">qwerty/qwerty.cpp</a>.<h3 class=fn>int <a name="widthMM"></a>QPaintDeviceMetrics::widthMM () const</h3><p> Returns the width of the paint device, measured in millimeters.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?