1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QGroupBox 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: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QGroupBox Class Reference</h1><br clear="all">
<p>
The QGroupBox widget provides a group box frame with a title.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qgroupbox-h.html">qgroupbox.h</a>></code>
<p>
Inherits <a href="qframe.html">QFrame</a>.
<p>Inherited by <a href="qbuttongroup.html">QButtonGroup</a>, <a href="qhgroupbox.html">QHGroupBox</a> and <a href="qvgroupbox.html">QVGroupBox</a>.
<p><a href="qgroupbox-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#c66620"><b>QGroupBox</b></a>(QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#f7a885"><b>QGroupBox</b></a>(constQString&title, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#39b6b3"><b>QGroupBox</b></a>(intcolumns, Orientationo, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#731da8"><b>QGroupBox</b></a>(intcolumns, Orientationo, constQString&title, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn">virtualvoid<a href="#452922"><b>setColumnLayout</b></a>(intcolumns, Orientationo)</div>
<li><div class="fn">QString<a href="#11687e"><b>title</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#fbfbcc"><b>setTitle</b></a>(constQString&)</div>
<li><div class="fn">int<a href="#bfb58a"><b>alignment</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#175179"><b>setAlignment</b></a>(int)</div>
<li><div class="fn">int<a href="#0cf38e"><b>columns</b></a>()const</div>
<li><div class="fn">void<a href="#b7d670"><b>setColumns</b></a>(int)</div>
<li><div class="fn">Orientation<a href="#2b7ba7"><b>orientation</b></a>()const</div>
<li><div class="fn">void<a href="#030389"><b>setOrientation</b></a>(Orientation)</div>
<li><div class="fn">void<a href="#f90189"><b>addSpace</b></a>(int)</div>
</ul>
<h2>Properties</h2>
<table border=1 cellpadding=3 cellspacing=0>
<tr><th>Type<th>Name<th>READ<th>WRITE<th>Options
<tr><td>QString<td>title<td>title<td>setTitle<td>
<tr><td>Alignment<td>alignment<td>alignment<td>setAlignment<td>
<tr><td>Orientation<td>orientation<td>orientation<td>setOrientation<td> DESIGNABLE false
<tr><td>int<td>columns<td>columns<td>setColumns<td> DESIGNABLE false
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QGroupBox widget provides a group box frame with a title.
<p>
A group box provides a frame, a title and a keyboard shortcut, and
displays various other widgets inside itself. The title is on top,
the keyboard shortcut moves keyboard focus to one of the group box'
child widgets, and the child widgets are arranged in an array inside
the frame.
<p>The simplest way to use it is to create a group box with the desired
number of columns and orientation, and then just create widgets with
the group box as parent.
<p>However, it is also possible to change the <a href="#2b7ba7">orientation</a>() and number
of <a href="#0cf38e">columns</a>() after construction, or to ignore all the automatic
layout support and manage all that yourself.
<p>QGroupBox also lets you set the <a href="#11687e">title</a>() (normally set in the
constructor) and if you so please, even the title's <a href="#bfb58a">alignment</a>().
<p><img src=qgrpbox-w.png>
<p>See also <a href="qbuttongroup.html">QButtonGroup</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="c66620"></a>QGroupBox::QGroupBox(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a group box widget with no title.
<p>The <em>parent</em> and <em>name</em> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.
<p>This constructor does not do automatic layout.
<h3 class="fn"><a name="f7a885"></a>QGroupBox::QGroupBox(const<a href="qstring.html">QString</a>&title, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a group box with a title.
<p>The <em>parent</em> and <em>name</em> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.
<p>This constructor does not do automatic layout.
<h3 class="fn"><a name="39b6b3"></a>QGroupBox::QGroupBox(intstrips, <a href="qt.html#Orientation">Orientation</a>orientation, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a group box with no title. Child widgets will be arranged
in <em>strips</em> rows or columns (depending on <em>orientation).</em>
<p>The <em>parent</em> and <em>name</em> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.
<h3 class="fn"><a name="731da8"></a>QGroupBox::QGroupBox(intstrips, <a href="qt.html#Orientation">Orientation</a>orientation, const<a href="qstring.html">QString</a>&title, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a group box titled <em>title.</em> Child widgets will be arranged
in <em>strips</em> rows or columns (depending on <em>orientation).</em>
<p>The <em>parent</em> and <em>name</em> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.
<h3 class="fn">void<a name="f90189"></a>QGroupBox::addSpace(intsize)</h3>
<p>Adds an empty cell at the next free position. If <em>size</em> is greater
than 0 then the empty cell has a fixed height or width.
If the groupbox is oriented horizontally then the empty cell has a fixed
height and if oriented vertically it has a fixed width.
<p>Use this method to separate the widgets in the groupbox or to skip
the next free cell. For performance reasons call this method after
calling <a href="#452922">setColumnLayout</a>(), <a href="#b7d670">setColumns</a>() or <a href="#030389">setOrientation</a>(). It is in
general a good idea to call these methods first (if needed at all) and
insert the widgets and spaces afterwards.
<h3 class="fn">int<a name="bfb58a"></a>QGroupBox::alignment()const</h3>
<p>Returns the alignment of the group box title.
<p>The default alignment is <code>AlignLeft.</code>
<p>See also <a href="#175179">setAlignment</a>() and <a href="qt.html#AlignmentFlags">Qt::AlignmentFlags</a>.
<h3 class="fn">void<a name="7bebe3"></a>QGroupBox::childEvent(<a href="qchildevent.html">QChildEvent</a>*c) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qobject.html#27f3ff">QObject.</a>
<h3 class="fn">int<a name="0cf38e"></a>QGroupBox::columns()const</h3>
<p>Returns the numbers of columns in the groupbox as passed to
the constructor, <a href="#b7d670">setColumns</a>() or <a href="#452922">setColumnLayout</a>().
<h3 class="fn">bool<a name="a9f3d2"></a>QGroupBox::event(<a href="qevent.html">QEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qobject.html#c67adb">QObject.</a>
<h3 class="fn">void<a name="5b5439"></a>QGroupBox::focusInEvent(<a href="qfocusevent.html">QFocusEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#21a4b8">QWidget.</a>
<h3 class="fn">void<a name="25b1c0"></a>QGroupBox::fontChange(const<a href="qfont.html">QFont</a>&oldFont) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#ac5c83">QWidget.</a>
<h3 class="fn"><a href="qt.html#Orientation">Orientation</a><a name="2b7ba7"></a>QGroupBox::orientation()const</h3>
<p>Returns the current orientation of the groupbox.
<p>See also <a href="#030389">setOrientation</a>().
<h3 class="fn">void<a name="9ff0d8"></a>QGroupBox::paintEvent(<a href="qpaintevent.html">QPaintEvent</a>*event) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#e3d821">QWidget.</a>
<h3 class="fn">void<a name="1a7b01"></a>QGroupBox::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#7d375f">QWidget.</a>
<h3 class="fn">void<a name="175179"></a>QGroupBox::setAlignment(intalignment) <code>[virtual]</code></h3>
<p>Sets the alignment of the group box title.
<p>The title is always placed on the upper frame line, however,
the horizontal alignment can be specified by the <em>alignment</em> parameter.
<p>The <em>alignment</em> is one of the following flags:
<ul>
<li> <code>AlignLeft</code> aligns the title text to the left.
<li> <code>AlignRight</code> aligns the title text to the right.
<li> <code>AlignHCenter</code> aligns the title text centered.
</ul>
<p>See also <a href="#bfb58a">alignment</a>() and <a href="qt.html#AlignmentFlags">Qt::AlignmentFlags</a>.
<h3 class="fn">void<a name="452922"></a>QGroupBox::setColumnLayout(intcolumns, <a href="qt.html#Orientation">Orientation</a>direction) <code>[virtual]</code></h3>
<p>Changes the layout of the group box. This function is only useful in
combination with the default constructor that does not take any
layout information. This function will put all existing children in
the new layout. Nevertheless is is not good programming style to
call this function after children have been inserted.
<p>See also <a href="#030389">setOrientation</a>() and <a href="#b7d670">setColumns</a>().
<h3 class="fn">void<a name="b7d670"></a>QGroupBox::setColumns(intc)</h3>
<p>Changes the numbers of columns to <em>c.</em> Usually it is no good idea
to use the method since it is slow (it does a complete layout).
Better set the numbers of columns directly in the constructor.
<p>See also column() and <a href="#452922">setColumnLayout</a>().
<h3 class="fn">void<a name="030389"></a>QGroupBox::setOrientation(<a href="qt.html#Orientation">Qt::Orientation</a>o)</h3>
<p>Changes the orientation of the groupbox. Usually it is no good idea
to use the method since it is slow (it does a complete layout).
Better set the orientation directly in the constructor.
<p>See also <a href="#2b7ba7">orientation</a>().
<h3 class="fn">void<a name="fbfbcc"></a>QGroupBox::setTitle(const<a href="qstring.html">QString</a>&title) <code>[virtual]</code></h3>
<p>Sets the group box title text to <em>title,</em> and add a focus-change
accelerator if the <em>title</em> contains & followed by an appropriate
letter. This produces "User information" with the U underscored and
Alt-U moves the keyboard focus into the group:
<p><pre> g->setTitle( "&User information" );
</pre>
<h3 class="fn"><a href="qsize.html">QSize</a><a name="d7a142"></a>QGroupBox::sizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#4511d1">QWidget.</a>
<h3 class="fn"><a href="qstring.html">QString</a><a name="11687e"></a>QGroupBox::title()const</h3>
<p>Returns the group box title text.
<h3 class="fn">void<a name="ee7c67"></a>QGroupBox::updateMask() <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#b8a07f">QWidget.</a>
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<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 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|