Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 3927

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/src/gui/embedded/qdecoration_qws.cpp -->
<head>
  <title>Qt 4.2: QDecoration Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QDecoration Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QDecoration class allows the appearance of top level windows to be customized. <a href="#details">More...</a></p>
<pre> #include &lt;QDecoration&gt;</pre><ul>
<li><a href="qdecoration-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a></b> { All, Top, Bottom, Left, ..., None }</li>
<li><div class="fn"/>enum <b><a href="qdecoration.html#DecorationState-enum">DecorationState</a></b> { Normal, Disabled, Hover, Pressed }</li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qdecoration.html#QDecoration">QDecoration</a></b> ()</li>
<li><div class="fn"/>virtual <b><a href="qdecoration.html#dtor.QDecoration">~QDecoration</a></b> ()</li>
<li><div class="fn"/>virtual void <b><a href="qdecoration.html#buildSysMenu">buildSysMenu</a></b> ( QWidget * <i>widget</i>, QMenu * <i>menu</i> )</li>
<li><div class="fn"/>void <b><a href="qdecoration.html#menuTriggered">menuTriggered</a></b> ( QWidget * <i>widget</i>, QAction * <i>action</i> )</li>
<li><div class="fn"/>virtual bool <b><a href="qdecoration.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QWidget * <i>widget</i>, int <i>decorationRegion</i> = All, DecorationState <i>state</i> = Normal ) = 0</li>
<li><div class="fn"/>virtual QRegion <b><a href="qdecoration.html#region">region</a></b> ( const QWidget * <i>widget</i>, const QRect &amp; <i>rectangle</i>, int <i>decorationRegion</i> = All ) = 0</li>
<li><div class="fn"/>QRegion <b><a href="qdecoration.html#region-2">region</a></b> ( const QWidget * <i>widget</i>, int <i>decorationRegion</i> = All )</li>
<li><div class="fn"/>virtual int <b><a href="qdecoration.html#regionAt">regionAt</a></b> ( const QWidget * <i>widget</i>, const QPoint &amp; <i>point</i> )</li>
<li><div class="fn"/>virtual void <b><a href="qdecoration.html#regionClicked">regionClicked</a></b> ( QWidget * <i>widget</i>, int <i>region</i> )</li>
<li><div class="fn"/>virtual void <b><a href="qdecoration.html#regionDoubleClicked">regionDoubleClicked</a></b> ( QWidget * <i>widget</i>, int <i>region</i> )</li>
</ul>
<a name="static-public-members"></a>
<h3>Static Public Members</h3>
<ul>
<li><div class="fn"/>void <b><a href="qdecoration.html#startMove">startMove</a></b> ( QWidget * <i>widget</i> )</li>
<li><div class="fn"/>void <b><a href="qdecoration.html#startResize">startResize</a></b> ( QWidget * <i>widget</i> )</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QDecoration class allows the appearance of top level windows to be customized.</p>
<p>Note that this class is non-portable, and that it is only available in <a href="qtopiacore.html">Qtopia Core</a>.</p>
<p><a href="qtopiacore.html">Qtopia Core</a> provides window management of top level windows. The appearance of the borders and buttons (the decoration) around these windows can be customized by deriving from the QDecoration class. Custom decorations can be added by subclassing the <a href="qdecorationplugin.html">QDecorationPlugin</a> class, using the <a href="qdecorationfactory.html">QDecorationFactory</a> class to dynamically load the decoration into the application. To actually apply a decoration to an application, use the <a href="qapplication.html#qwsSetDecoration">QApplication::qwsSetDecoration</a>() function.</p>
<p>The QDecoration class provides the virtual <a href="qdecoration.html#paint">paint</a>() function that can be reimplemented to paint the border and title decoration around a specified widget using a given painter and decoration state.</p>
<p>The <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> enum is used to specify which region to paint. This enum describes the various regions of the window decoration. The <a href="qdecoration.html#region">region</a>() function is used to retrieve the actual regions the decoration occupy. It is also possible to determine the type of region containing a given point, using the <a href="qdecoration.html#regionAt">regionAt</a>() function. The <a href="qdecoration.html#DecorationState-enum">DecorationState</a> enum is used to specify a region's state, e.g. whether it is active or not.</p>
<p>QDecoration also provides the possibility of building the system menu for a given top level widget with its virtual <a href="qdecoration.html#buildSysMenu">buildSysMenu</a>() function. The <a href="qdecoration.html#menuTriggered">menuTriggered</a>() function is called whenever an action in such a widget's menu is triggered.</p>
<p>The virtual <a href="qdecoration.html#regionClicked">regionClicked</a>() and <a href="qdecoration.html#regionDoubleClicked">regionDoubleClicked</a>() functions are provided to enable response to mouse clicks. The default implementations responds to (single) clicks on items in a widget's system menu and double clicks on a widget's title.</p>
<p>Finally, the QDecoration class provides a couple of static functions, <a href="qdecoration.html#startMove">startMove</a>() and <a href="qdecoration.html#startResize">startResize</a>(), which start the move or resize action by making the appropiate decoration region active and grabbing the mouse input.</p>
<p>See also <a href="qdecorationfactory.html">QDecorationFactory</a>, <a href="qdecorationplugin.html">QDecorationPlugin</a>, and <a href="qdirectpainter.html">QDirectPainter</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="DecorationRegion-enum"></a>enum QDecoration::DecorationRegion</h3>
<p>This enum describes the various regions of the window decoration.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDecoration::All</tt></td><td align="center" valign="top"><tt>0x7fffffff</tt></td><td valign="top">The entire region used by the window decoration.</td></tr>
<tr><td valign="top"><tt>QDecoration::Top</tt></td><td align="center" valign="top"><tt>0x0000000002</tt></td><td valign="top">The top border used to vertically resize the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Bottom</tt></td><td align="center" valign="top"><tt>0x0000000040</tt></td><td valign="top">The bottom border used to vertically resize the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Left</tt></td><td align="center" valign="top"><tt>0x0000000008</tt></td><td valign="top">The left border used to horizontally resize the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Right</tt></td><td align="center" valign="top"><tt>0x0000000010</tt></td><td valign="top">The right border used to horizontally resize the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::TopLeft</tt></td><td align="center" valign="top"><tt>0x0000000001</tt></td><td valign="top">The top-left corner of the window used to resize the window both horizontally and vertically.</td></tr>
<tr><td valign="top"><tt>QDecoration::TopRight</tt></td><td align="center" valign="top"><tt>0x0000000004</tt></td><td valign="top">The top-right corner of the window used to resize the window both horizontally and vertically.</td></tr>
<tr><td valign="top"><tt>QDecoration::BottomLeft</tt></td><td align="center" valign="top"><tt>0x0000000020</tt></td><td valign="top">The bottom-left corner of the window used to resize the window both horizontally and vertically.</td></tr>
<tr><td valign="top"><tt>QDecoration::BottomRight</tt></td><td align="center" valign="top"><tt>0x0000000080</tt></td><td valign="top">The bottom-right corner of the window used to resize the window both horizontally and vertically.</td></tr>
<tr><td valign="top"><tt>QDecoration::Borders</tt></td><td align="center" valign="top"><tt>0x00000000ff</tt></td><td valign="top">All the regions used to describe the window border.</td></tr>
<tr><td valign="top"><tt>QDecoration::Title</tt></td><td align="center" valign="top"><tt>0x0000000200</tt></td><td valign="top">The region containing the window title, used to move the window by dragging with the mouse cursor.</td></tr>
<tr><td valign="top"><tt>QDecoration::Close</tt></td><td align="center" valign="top"><tt>0x0000004000</tt></td><td valign="top">The region occupied by the close button. Clicking in this region closes the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Minimize</tt></td><td align="center" valign="top"><tt>0x0000000800</tt></td><td valign="top">The region occupied by the minimize button. Clicking in this region minimizes the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Maximize</tt></td><td align="center" valign="top"><tt>0x0000001000</tt></td><td valign="top">The region occupied by the maximize button. Clicking in this region maximizes the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Normalize</tt></td><td align="center" valign="top"><tt>0x0000002000</tt></td><td valign="top">The region occupied by a button used to restore a window's normal size. Clicking in this region restores a maximized window to its previous size. The region used for this button is often also the Maximize region.</td></tr>
<tr><td valign="top"><tt>QDecoration::Menu</tt></td><td align="center" valign="top"><tt>0x0000000100</tt></td><td valign="top">The region occupied by the window's menu button. Clicking in this region opens the window operations (system) menu.</td></tr>
<tr><td valign="top"><tt>QDecoration::Help</tt></td><td align="center" valign="top"><tt>0x0000000400</tt></td><td valign="top">The region occupied by the window's help button. Clicking in this region causes the context-sensitive help function to be enabled.</td></tr>
<tr><td valign="top"><tt>QDecoration::Resize</tt></td><td align="center" valign="top"><tt>0x0000010000</tt></td><td valign="top">The region used to resize the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::Move</tt></td><td align="center" valign="top"><tt>0x0000008000</tt></td><td valign="top">The region used to move the window.</td></tr>
<tr><td valign="top"><tt>QDecoration::None</tt></td><td align="center" valign="top"><tt>0x0000000000</tt></td><td valign="top">No region.</td></tr>
</table></p>
<p>See also <a href="qdecoration.html#region">region</a>(), <a href="qdecoration.html#regionAt">regionAt</a>(), and <a href="qdecoration.html#DecorationState-enum">DecorationState</a>.</p>
<h3 class="fn"><a name="DecorationState-enum"></a>enum QDecoration::DecorationState</h3>
<p>This enum describes the various states of a decoration region.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDecoration::Normal</tt></td><td align="center" valign="top"><tt>0x04</tt></td><td valign="top">The region is active</td></tr>
<tr><td valign="top"><tt>QDecoration::Disabled</tt></td><td align="center" valign="top"><tt>0x08</tt></td><td valign="top">The region is inactive.</td></tr>
<tr><td valign="top"><tt>QDecoration::Hover</tt></td><td align="center" valign="top"><tt>0x01</tt></td><td valign="top">The cursor is hovering over the region.</td></tr>
<tr><td valign="top"><tt>QDecoration::Pressed</tt></td><td align="center" valign="top"><tt>0x02</tt></td><td valign="top">The region is pressed.</td></tr>
</table></p>
<p>See also <a href="qdecoration.html#paint">paint</a>() and <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QDecoration"></a>QDecoration::QDecoration ()</h3>
<p>Constructs a decoration object.</p>
<h3 class="fn"><a name="dtor.QDecoration"></a>QDecoration::~QDecoration ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys this decoration object.</p>
<h3 class="fn"><a name="buildSysMenu"></a>void QDecoration::buildSysMenu ( <a href="qwidget.html">QWidget</a> * <i>widget</i>, <a href="qmenu.html">QMenu</a> * <i>menu</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Builds the system <i>menu</i> for the given top level <i>widget</i>.</p>
<p>See also <a href="qdecoration.html#menuTriggered">menuTriggered</a>().</p>
<h3 class="fn"><a name="menuTriggered"></a>void QDecoration::menuTriggered ( <a href="qwidget.html">QWidget</a> * <i>widget</i>, <a href="qaction.html">QAction</a> * <i>action</i> )</h3>
<p>This function is called whenever an action in a top level widget's menu is triggered. Pointers to the <i>widget</i> and <i>action</i> are passed as arguments.</p>
<p>See also <a href="qdecoration.html#buildSysMenu">buildSysMenu</a>().</p>
<h3 class="fn"><a name="paint"></a>bool QDecoration::paint ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qwidget.html">QWidget</a> * <i>widget</i>, int <i>decorationRegion</i> = All, <a href="qdecoration.html#DecorationState-enum">DecorationState</a> <i>state</i> = Normal )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>This virtual function allows subclasses of <a href="qdecoration.html">QDecoration</a> to paint the border and title decoration for the specified top level <i>widget</i> using the given <i>painter</i> and <i>state</i>.</p>
<p>The specified <i>decorationRegion</i> is a bitmask of the values described by the <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> enum.</p>
<h3 class="fn"><a name="region"></a><a href="qregion.html">QRegion</a> QDecoration::region ( const <a href="qwidget.html">QWidget</a> * <i>widget</i>, const <a href="qrect.html">QRect</a> &amp; <i>rectangle</i>, int <i>decorationRegion</i> = All )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the region specified by <i>decorationRegion</i>, for the given top level <i>widget</i>.</p>
<p>The <i>rectangle</i> parameter specifies the rectangle the decoration is wrapped around. The <i>decorationRegion</i> is a bitmask of the values described by the <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> enum.</p>
<p>See also <a href="qdecoration.html#regionAt">regionAt</a>().</p>
<h3 class="fn"><a name="region-2"></a><a href="qregion.html">QRegion</a> QDecoration::region ( const <a href="qwidget.html">QWidget</a> * <i>widget</i>, int <i>decorationRegion</i> = All )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns the region specified by <i>decorationRegion</i> containing the given <i>widget</i>. The <i>decorationRegion</i> is a bitmask of the values described by the <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> enum.</p>
<h3 class="fn"><a name="regionAt"></a>int QDecoration::regionAt ( const <a href="qwidget.html">QWidget</a> * <i>widget</i>, const <a href="qpoint.html">QPoint</a> &amp; <i>point</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the type of the first region of the specified top level <i>widget</i> containing the given <i>point</i>.</p>
<p>The return value is one of the <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> enum's values. Use the <a href="qdecoration.html#region">region</a>() function to retrieve the actual region. If none of the widget's regions contain the point, this function returns <a href="qdecoration.html#DecorationRegion-enum">None</a>.</p>
<p>See also <a href="qdecoration.html#region">region</a>().</p>
<h3 class="fn"><a name="regionClicked"></a>void QDecoration::regionClicked ( <a href="qwidget.html">QWidget</a> * <i>widget</i>, int <i>region</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This function is called whenever a region in a top level widget is clicked. The parameters specifies the <i>widget</i> as well as the <i>region</i>. Note that the <i>region</i> parameter is one of the <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> values.</p>
<p>The default implementation responds to clicks on items in the system menu, performing the requested actions.</p>
<p>See also <a href="qdecoration.html#regionDoubleClicked">regionDoubleClicked</a>().</p>
<h3 class="fn"><a name="regionDoubleClicked"></a>void QDecoration::regionDoubleClicked ( <a href="qwidget.html">QWidget</a> * <i>widget</i>, int <i>region</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This function is called whenever a region in a top level widget is double clicked. The parameters specifies the <i>widget</i> as well as the <i>region</i>. Note that the <i>region</i> parameter is one of the <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a> values.</p>
<p>The default implementation responds to a double click on the widget's title, toggling its size between the maximum and its normal size.</p>
<p>See also <a href="qdecoration.html#regionClicked">regionClicked</a>().</p>
<h3 class="fn"><a name="startMove"></a>void QDecoration::startMove ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Starts to move the given <i>widget</i> by making its <a href="qdecoration.html#DecorationRegion-enum">Title</a> region active and grabbing the mouse input. The <i>widget</i> must be a top level widget.</p>
<p>See also <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a>.</p>
<h3 class="fn"><a name="startResize"></a>void QDecoration::startResize ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Starts to resize the given <i>widget</i> by making its <a href="qdecoration.html#DecorationRegion-enum">BottomRight</a> region active and grabbing the mouse input. The <i>widget</i> must be a top level widget.</p>
<p>See also <a href="qdecoration.html#DecorationRegion-enum">DecorationRegion</a>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>