Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4879

qt4-doc-4.6.3-0.2mdv2010.2.i586.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">
<!-- qsplitter.cpp -->
<head>
  <title>Qt 4.6: QSplitterHandle Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QSplitterHandle"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" 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="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QSplitterHandle Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QSplitterHandle class provides handle functionality of the splitter. <a href="#details">More...</a></p>
<pre> #include &lt;QSplitterHandle&gt;</pre><p>Inherits <a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qsplitterhandle-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#QSplitterHandle">QSplitterHandle</a></b> ( Qt::Orientation <i>orientation</i>, QSplitter * <i>parent</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#opaqueResize">opaqueResize</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Qt::Orientation </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#orientation">orientation</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#setOrientation">setOrientation</a></b> ( Qt::Orientation <i>orientation</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QSplitter * </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#splitter">splitter</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#sizeHint">sizeHint</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#closestLegalPosition">closestLegalPosition</a></b> ( int <i>pos</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#moveSplitter">moveSplitter</a></b> ( int <i>pos</i> )</td></tr>
</table>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsplitterhandle.html#paintEvent">paintEvent</a></b> ( QPaintEvent * )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QSplitterHandle class provides handle functionality of the splitter.</p>
<p>QSplitterHandle is typically what people think about when they think about a splitter. It is the handle that is used to resize the widgets.</p>
<p>A typical developer using <a href="qsplitter.html">QSplitter</a> will never have to worry about QSplitterHandle. It is provided for developers who want splitter handles that provide extra features, such as popup menus.</p>
<p>The typical way one would create splitter handles is to subclass <a href="qsplitter.html">QSplitter</a> then reimplement <a href="qsplitter.html#createHandle">QSplitter::createHandle</a>() to instantiate the custom splitter handle. For example, a minimum <a href="qsplitter.html">QSplitter</a> subclass might look like this:</p>
<pre> class Splitter : public QSplitter
 {
 public:
     Splitter(Qt::Orientation orientation, QWidget *parent = 0);

 protected:
     QSplitterHandle *createHandle();
 };</pre>
<p>The <a href="qsplitter.html#createHandle">createHandle()</a> implementation simply constructs a custom splitter handle, called <tt>Splitter</tt> in this example:</p>
<pre> QSplitterHandle *Splitter::createHandle()
 {
     return new SplitterHandle(orientation(), this);
 }</pre>
<p>Information about a given handle can be obtained using functions like <a href="qsplitterhandle.html#orientation">orientation</a>() and <a href="qsplitterhandle.html#opaqueResize">opaqueResize</a>(), and is retrieved from its parent splitter. Details like these can be used to give custom handles different appearances depending on the splitter's orientation.</p>
<p>The complexity of a custom handle subclass depends on the tasks that it needs to perform. A simple subclass might only provide a <a href="qsplitterhandle.html#paintEvent">paintEvent</a>() implementation:</p>
<pre> void SplitterHandle::paintEvent(QPaintEvent *event)
 {
     QPainter painter(this);
     if (orientation() == Qt::Horizontal) {
         gradient.setStart(rect().left(), rect().height()/2);
         gradient.setFinalStop(rect().right(), rect().height()/2);
     } else {
         gradient.setStart(rect().width()/2, rect().top());
         gradient.setFinalStop(rect().width()/2, rect().bottom());
     }
     painter.fillRect(event-&gt;rect(), QBrush(gradient));
 }</pre>
<p>In this example, a predefined gradient is set up differently depending on the orientation of the handle. QSplitterHandle provides a reasonable size hint for the handle, so the subclass does not need to provide a reimplementation of <a href="qsplitterhandle.html#sizeHint">sizeHint</a>() unless the handle has special size requirements.</p>
<p>See also <a href="qsplitter.html">QSplitter</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QSplitterHandle/QSplitterHandle"></a>
<h3 class="fn"><a name="QSplitterHandle"></a>QSplitterHandle::QSplitterHandle ( <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, <a href="qsplitter.html">QSplitter</a> * <i>parent</i> )</h3>
<p>Creates a <a href="qsplitter.html">QSplitter</a> handle with the given <i>orientation</i> and <a href="qsplitter.html">QSplitter</a> <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/closestLegalPosition"></a>
<h3 class="fn"><a name="closestLegalPosition"></a>int QSplitterHandle::closestLegalPosition ( int <i>pos</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
<p>Returns the closest legal position to <i>pos</i> of the splitter handle. The positions are measured from the left or top edge of the splitter, even for right-to-left languages.</p>
<p>See also <a href="qsplitter.html#closestLegalPosition">QSplitter::closestLegalPosition</a>() and <a href="qsplitterhandle.html#moveSplitter">moveSplitter</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/event"></a>
<h3 class="fn"><a name="event"></a>bool QSplitterHandle::event ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/mouseMoveEvent"></a>
<h3 class="fn"><a name="mouseMoveEvent"></a>void QSplitterHandle::mouseMoveEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/mousePressEvent"></a>
<h3 class="fn"><a name="mousePressEvent"></a>void QSplitterHandle::mousePressEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/mouseReleaseEvent"></a>
<h3 class="fn"><a name="mouseReleaseEvent"></a>void QSplitterHandle::mouseReleaseEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/moveSplitter"></a>
<h3 class="fn"><a name="moveSplitter"></a>void QSplitterHandle::moveSplitter ( int <i>pos</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
<p>Tells the splitter to move this handle to position <i>pos</i>, which is the distance from the left or top edge of the widget.</p>
<p>Note that <i>pos</i> is also measured from the left (or top) for right-to-left languages. This function will map <i>pos</i> to the appropriate position before calling <a href="qsplitter.html#moveSplitter">QSplitter::moveSplitter</a>().</p>
<p>See also <a href="qsplitter.html#moveSplitter">QSplitter::moveSplitter</a>() and <a href="qsplitterhandle.html#closestLegalPosition">closestLegalPosition</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/opaqueResize"></a>
<h3 class="fn"><a name="opaqueResize"></a>bool QSplitterHandle::opaqueResize () const</h3>
<p>Returns true if widgets are resized dynamically (opaquely), otherwise returns false. This value is controlled by the <a href="qsplitter.html">QSplitter</a>.</p>
<p>See also <a href="qsplitter.html#opaqueResize-prop">QSplitter::opaqueResize</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/orientation"></a>
<h3 class="fn"><a name="orientation"></a><a href="qt.html#Orientation-enum">Qt::Orientation</a> QSplitterHandle::orientation () const</h3>
<p>Returns the handle's orientation. This is usually propagated from the <a href="qsplitter.html">QSplitter</a>.</p>
<p>See also <a href="qsplitterhandle.html#setOrientation">setOrientation</a>() and <a href="qsplitter.html#orientation-prop">QSplitter::orientation</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/paintEvent"></a>
<h3 class="fn"><a name="paintEvent"></a>void QSplitterHandle::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/setOrientation"></a>
<h3 class="fn"><a name="setOrientation"></a>void QSplitterHandle::setOrientation ( <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i> )</h3>
<p>Sets the orientation of the splitter handle to <i>orientation</i>. This is usually propogated from the <a href="qsplitter.html">QSplitter</a>.</p>
<p>See also <a href="qsplitterhandle.html#orientation">orientation</a>() and <a href="qsplitter.html#orientation-prop">QSplitter::setOrientation</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/sizeHint"></a>
<h3 class="fn"><a name="sizeHint"></a><a href="qsize.html">QSize</a> QSplitterHandle::sizeHint () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QSplitterHandle/splitter"></a>
<h3 class="fn"><a name="splitter"></a><a href="qsplitter.html">QSplitter</a> * QSplitterHandle::splitter () const</h3>
<p>Returns the splitter associated with this splitter handle.</p>
<p>See also <a href="qsplitter.html#handle">QSplitter::handle</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>