Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 397cf13019f8c526877f271962f26f4c > files > 1860

libqt3-devel-3.1.1-13mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/reggie/tmp/qt-3.1-reggie-23625/qt-x11-free-3.1.1/src/widgets/qsplitter.cpp:212 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QSplitter 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>QSplitter Class Reference</h1>

<p>The QSplitter class implements a splitter widget.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qsplitter-h.html">qsplitter.h</a>&gt;</tt>
<p>Inherits <a href="qframe.html">QFrame</a>.
<p><a href="qsplitter-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn>enum <a href="#ResizeMode-enum"><b>ResizeMode</b></a> { Stretch, KeepSize, FollowSizeHint, Auto }</div></li>
<li><div class=fn><a href="#QSplitter"><b>QSplitter</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#QSplitter-2"><b>QSplitter</b></a> ( Orientation&nbsp;o, QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#~QSplitter"><b>~QSplitter</b></a> ()</div></li>
<li><div class=fn>virtual void <a href="#setOrientation"><b>setOrientation</b></a> ( Orientation )</div></li>
<li><div class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setResizeMode"><b>setResizeMode</b></a> ( QWidget&nbsp;*&nbsp;w, ResizeMode&nbsp;mode )</div></li>
<li><div class=fn>virtual void <a href="#setOpaqueResize"><b>setOpaqueResize</b></a> ( bool&nbsp;on = TRUE )</div></li>
<li><div class=fn>bool <a href="#opaqueResize"><b>opaqueResize</b></a> () const</div></li>
<li><div class=fn>void <a href="#moveToFirst"><b>moveToFirst</b></a> ( QWidget&nbsp;*&nbsp;w )</div></li>
<li><div class=fn>void <a href="#moveToLast"><b>moveToLast</b></a> ( QWidget&nbsp;*&nbsp;w )</div></li>
<li><div class=fn>void <a href="#refresh"><b>refresh</b></a> ()</div></li>
<li><div class=fn>QValueList&lt;int&gt; <a href="#sizes"><b>sizes</b></a> () const</div></li>
<li><div class=fn>void <a href="#setSizes"><b>setSizes</b></a> ( QValueList&lt;int&gt;&nbsp;list )</div></li>
</ul>
<h2>Properties</h2>
<ul>
<li><div class=fn>Orientation <a href="#orientation-prop"><b>orientation</b></a>&nbsp;- the orientation of the splitter</div></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class=fn>virtual void <a href="#childEvent"><b>childEvent</b></a> ( QChildEvent&nbsp;*&nbsp;c )</div></li>
<li><div class=fn>int <a href="#idAfter"><b>idAfter</b></a> ( QWidget&nbsp;*&nbsp;w ) const</div></li>
<li><div class=fn>void <a href="#moveSplitter"><b>moveSplitter</b></a> ( QCOORD&nbsp;p, int&nbsp;id )</div></li>
<li><div class=fn>virtual void drawSplitter ( QPainter&nbsp;*&nbsp;p, QCOORD&nbsp;x, QCOORD&nbsp;y, QCOORD&nbsp;w, QCOORD&nbsp;h ) &nbsp;<em>(obsolete)</em></div></li>
<li><div class=fn>int <a href="#adjustPos"><b>adjustPos</b></a> ( int&nbsp;pos, int&nbsp;id )</div></li>
<li><div class=fn>virtual void <a href="#setRubberband"><b>setRubberband</b></a> ( int&nbsp;p )</div></li>
<li><div class=fn>void <a href="#getRange"><b>getRange</b></a> ( int&nbsp;id, int&nbsp;*&nbsp;min, int&nbsp;*&nbsp;max )</div></li>
</ul>
<h2>Related Functions</h2>
<ul>
<li><div class=fn>QTextStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( QTextStream&nbsp;&amp;&nbsp;ts, const&nbsp;QSplitter&nbsp;&amp;&nbsp;splitter )</div></li>
<li><div class=fn>QTextStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( QTextStream&nbsp;&amp;&nbsp;ts, QSplitter&nbsp;&amp;&nbsp;splitter )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QSplitter class implements a splitter widget.
<p> 

<p> A splitter lets the user control the size of child widgets by
dragging the boundary between the children. Any number of widgets
may be controlled.
<p> To show a <a href="qlistbox.html">QListBox</a>, a <a href="qlistview.html">QListView</a> and a <a href="qtextedit.html">QTextEdit</a> side by side:
<pre>
        QSplitter *split = new QSplitter( parent );
        <a href="qlistbox.html">QListBox</a> *lb = new <a href="qlistbox.html">QListBox</a>( split );
        <a href="qlistview.html">QListView</a> *lv = new <a href="qlistview.html">QListView</a>( split );
        <a href="qtextedit.html">QTextEdit</a> *ed = new <a href="qtextedit.html">QTextEdit</a>( split );
    </pre>
 
<p> In QSplitter the boundary can be either horizontal or vertical.
The default is horizontal (the children are side by side) but you
can use <a href="#setOrientation">setOrientation</a>( QSplitter::Vertical ) to set it to
vertical.
<p> By default, all widgets can be as large or as small as the user
wishes, between the <a href="qwidget.html#minimumSizeHint">minimumSizeHint</a>() (or <a href="qwidget.html#minimumSize">minimumSize</a>())
and <a href="qwidget.html#maximumSize">maximumSize</a>() of the widgets. Use <a href="#setResizeMode">setResizeMode</a>() to
specify that a widget should keep its size when the splitter is
resized, or set the stretch component of the <a href="qwidget.html#sizePolicy-prop">sizePolicy</a>.
<p> Although QSplitter normally resizes the children only at the end
of a resize operation, if you call <a href="#setOpaqueResize">setOpaqueResize</a>( TRUE ) the
widgets are resized as often as possible.
<p> The initial distribution of size between the widgets is determined
by the initial size of each widget. You can also use <a href="#setSizes">setSizes</a>() to
set the sizes of all the widgets. The function <a href="#sizes">sizes</a>() returns the
sizes set by the user.
<p> If you <a href="qwidget.html#hide">hide</a>() a child its space will be distributed among the
other children. It will be reinstated when you <a href="qwidget.html#show">show</a>() it again. It
is also possible to reorder the widgets within the splitter using
<a href="#moveToFirst">moveToFirst</a>() and <a href="#moveToLast">moveToLast</a>().
<p> <img src=qsplitter-m.png> <img src=qsplitter-w.png>
<p> <p>See also <a href="qtabbar.html">QTabBar</a> and <a href="organizers.html">Organizers</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="ResizeMode-enum"></a>QSplitter::ResizeMode</h3>

<p> This enum type describes how QSplitter will resize each of its
child widgets.
<ul>
<li><tt>QSplitter::Auto</tt> - The widget will be resized according to the stretch
factors set in its <a href="qwidget.html#sizePolicy">sizePolicy</a>().
<li><tt>QSplitter::Stretch</tt> - The widget will be resized when the splitter
itself is resized.
<li><tt>QSplitter::KeepSize</tt> - QSplitter will try to keep this widget's size
unchanged.
<li><tt>QSplitter::FollowSizeHint</tt> - QSplitter will resize the widget when the
widget's size hint changes.
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QSplitter"></a>QSplitter::QSplitter ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a horizontal splitter with the <em>parent</em> and <em>name</em>
arguments being passed on to the <a href="qframe.html">QFrame</a> constructor.

<h3 class=fn><a name="QSplitter-2"></a>QSplitter::QSplitter ( <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;o, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a splitter with orientation <em>o</em> with the <em>parent</em> and
<em>name</em> arguments being passed on to the <a href="qframe.html">QFrame</a> constructor.

<h3 class=fn><a name="~QSplitter"></a>QSplitter::~QSplitter ()
</h3>
Destroys the splitter and any children.

<h3 class=fn>int <a name="adjustPos"></a>QSplitter::adjustPos ( int&nbsp;pos, int&nbsp;id )<tt> [protected]</tt>
</h3>
Returns the closest legal position to <em>pos</em> of the splitter with
ID <em>id</em>.
<p> <p>See also <a href="#idAfter">idAfter</a>().

<h3 class=fn>void <a name="childEvent"></a>QSplitter::childEvent ( <a href="qchildevent.html">QChildEvent</a>&nbsp;*&nbsp;c )<tt> [virtual protected]</tt>
</h3>
Tells the splitter that a child widget has been inserted or
removed. The event is passed in <em>c</em>.

<p>Reimplemented from <a href="qobject.html#childEvent">QObject</a>.
<h3 class=fn>void <a name="drawSplitter"></a>QSplitter::drawSplitter ( <a href="qpainter.html">QPainter</a>&nbsp;*&nbsp;p, QCOORD&nbsp;x, QCOORD&nbsp;y, QCOORD&nbsp;w, QCOORD&nbsp;h )<tt> [virtual protected]</tt>
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Draws the splitter handle in the rectangle described by <em>x</em>, <em>y</em>,
<em>w</em>, <em>h</em> using painter <em>p</em>.
<p>See also <a href="qstyle.html#drawPrimitive">QStyle::drawPrimitive</a>().

<h3 class=fn>void <a name="getRange"></a>QSplitter::getRange ( int&nbsp;id, int&nbsp;*&nbsp;min, int&nbsp;*&nbsp;max )<tt> [protected]</tt>
</h3>
Returns the valid range of the splitter with ID <em>id</em> in <em>*min</em>
and <em>*max</em> if <em>min</em> and <em>max</em> are not 0.
<p> <p>See also <a href="#idAfter">idAfter</a>().

<h3 class=fn>int <a name="idAfter"></a>QSplitter::idAfter ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w ) const<tt> [protected]</tt>
</h3>
Returns the ID of the splitter to the right of or below the widget
<em>w</em>, or 0 if there is no such splitter (i.e. it is either not in
this QSplitter or it is at the end).

<h3 class=fn>void <a name="moveSplitter"></a>QSplitter::moveSplitter ( QCOORD&nbsp;p, int&nbsp;id )<tt> [protected]</tt>
</h3>
Moves the left/top edge of the splitter handle with ID <em>id</em> as
close as possible to position <em>p</em>, which is the distance from the
left (or top) edge of the widget.
<p> For Arabic and Hebrew the layout is reversed, and using this
function to set the position of the splitter might lead to
unexpected results, since in Arabic and Hebrew the position of
splitter one is to the left of the position of splitter zero.
<p> <p>See also <a href="#idAfter">idAfter</a>().

<h3 class=fn>void <a name="moveToFirst"></a>QSplitter::moveToFirst ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w )
</h3>
Moves widget <em>w</em> to the leftmost/top position.

<p>Example: <a href="splitter-example.html#x1467">splitter/splitter.cpp</a>.
<h3 class=fn>void <a name="moveToLast"></a>QSplitter::moveToLast ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w )
</h3>
Moves widget <em>w</em> to the rightmost/bottom position.

<h3 class=fn>bool <a name="opaqueResize"></a>QSplitter::opaqueResize () const
</h3>
Returns TRUE if opaque resize is on; otherwise returns FALSE.
<p> <p>See also <a href="#setOpaqueResize">setOpaqueResize</a>().

<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QSplitter::orientation () const
</h3><p>Returns the orientation of the splitter.
See the <a href="qsplitter.html#orientation-prop">"orientation"</a> property for details.
<h3 class=fn>void <a name="refresh"></a>QSplitter::refresh ()
</h3>

<p> Updates the splitter's state. You should not need to call this
function.

<h3 class=fn>void <a name="setOpaqueResize"></a>QSplitter::setOpaqueResize ( bool&nbsp;on = TRUE )<tt> [virtual]</tt>
</h3>
If <em>on</em> is TRUE then opaque resizing is turned on; otherwise
opaque resizing is turned off. Opaque resizing is initially turned
off.
<p> <p>See also <a href="#opaqueResize">opaqueResize</a>().

<p>Example: <a href="splitter-example.html#x1468">splitter/splitter.cpp</a>.
<h3 class=fn>void <a name="setOrientation"></a>QSplitter::setOrientation ( <a href="qt.html#Orientation-enum">Orientation</a> )<tt> [virtual]</tt>
</h3><p>Sets the orientation of the splitter.
See the <a href="qsplitter.html#orientation-prop">"orientation"</a> property for details.
<h3 class=fn>void <a name="setResizeMode"></a>QSplitter::setResizeMode ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;w, <a href="qsplitter.html#ResizeMode-enum">ResizeMode</a>&nbsp;mode )<tt> [virtual]</tt>
</h3>
Sets resize mode of widget <em>w</em> to <em>mode</em>. (The default is <a href="#ResizeMode-enum">Auto</a>.)

<p>Examples: <a href="fileiconview-example.html#x885">fileiconview/mainwindow.cpp</a>, <a href="listviews-example.html#x129">listviews/listviews.cpp</a>, and <a href="splitter-example.html#x1469">splitter/splitter.cpp</a>.
<h3 class=fn>void <a name="setRubberband"></a>QSplitter::setRubberband ( int&nbsp;p )<tt> [virtual protected]</tt>
</h3>
Shows a rubber band at position <em>p</em>. If <em>p</em> is negative, the
rubber band is removed.

<h3 class=fn>void <a name="setSizes"></a>QSplitter::setSizes ( <a href="qvaluelist.html">QValueList</a>&lt;int&gt;&nbsp;list )
</h3>
Sets the size parameters to the values given in <em>list</em>. If the
splitter is horizontal, the values set the sizes from left to
right. If it is vertical, the sizes are applied from top to
bottom. Extra values in <em>list</em> are ignored.
<p> If <em>list</em> contains too few values, the result is undefined but
the program will still be well-behaved.
<p> <p>See also <a href="#sizes">sizes</a>().

<h3 class=fn><a href="qvaluelist.html">QValueList</a>&lt;int&gt; <a name="sizes"></a>QSplitter::sizes () const
</h3>
Returns a list of the size parameters of all the widgets in this
splitter.
<p> Giving the values to another splitter's <a href="#setSizes">setSizes</a>() function will
produce a splitter with the same layout as this one.
<p> Note that if you want to iterate over the list, you should iterate
over a copy, e.g.
<pre>
    <a href="qvaluelist.html">QValueList</a>&lt;int&gt; list = mySplitter.sizes();
    QValueList&lt;int&gt;::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
    while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
        myProcessing( *it );
        ++it;
    }
    </pre>
 
<p> <p>See also <a href="#setSizes">setSizes</a>().

<hr><h2>Property Documentation</h2>
<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation-prop"></a>orientation</h3>
<p>This property holds the orientation of the splitter.
<p>By default the orientation is horizontal (the widgets are side by
side). The possible orientations are <tt>Qt:Vertical</tt> and
<a href="qt.html#Orientation-enum">Qt::Horizontal</a> (the default).

<p>Set this property's value with <a href="#setOrientation">setOrientation</a>() and get this property's value with <a href="#orientation">orientation</a>().
<hr><h2>Related Functions</h2>
<h3 class=fn><a href="qtextstream.html">QTextStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qtextstream.html">QTextStream</a>&nbsp;&amp;&nbsp;ts, const&nbsp;<a href="qsplitter.html">QSplitter</a>&nbsp;&amp;&nbsp;splitter )
</h3>

<p> Writes the sizes and the hidden state of the widgets in the
splitter <em>splitter</em> to the text stream <em>ts</em>.
<p> <p>See also <a href="#operator-gt-gt">operator&gt;&gt;</a>(), <a href="#sizes">sizes</a>(), and <a href="qwidget.html#hidden-prop">QWidget::hidden</a>.

<h3 class=fn><a href="qtextstream.html">QTextStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qtextstream.html">QTextStream</a>&nbsp;&amp;&nbsp;ts, <a href="qsplitter.html">QSplitter</a>&nbsp;&amp;&nbsp;splitter )
</h3>

<p> Reads the sizes and the hidden state of the widgets in the
splitter <em>splitter</em> from the text stream <em>ts</em>. The sizes must
have been previously written by the <a href="#operator-lt-lt">operator&lt;&lt;</a>() function.
<p> <p>See also <a href="#operator-lt-lt">operator&lt;&lt;</a>(), <a href="#setSizes">setSizes</a>(), and <a href="qwidget.html#hide">QWidget::hide</a>().

<!-- 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.1.1</div>
</table></div></address></body>
</html>