<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>QFrame Class Reference</h1>
<p>The QFrame class is the base class of widgets that can have a frame.
<p> The QFrame class can also be used directly for creating simple
frames without any contents, although usually you would use a
<ahref="qhbox.html">QHBox</a> or <ahref="qvbox.html">QVBox</a> because they automatically lay out the widgets you
put inside the frame.
<p> A frame widget has four attributes: <ahref="#frameStyle">frameStyle</a>(), <ahref="#lineWidth">lineWidth</a>(),
<ahref="#midLineWidth">midLineWidth</a>(), and <ahref="#margin">margin</a>().
<p> The frame style is specified by a <ahref="#Shape-enum">frame
shape</a> and a <ahref="#Shadow-enum">shadow style</a>. The
frame shapes are <ahref="#Shape-enum">NoFrame</a>, <ahref="#Shape-enum">Box</a>, <ahref="#Shape-enum">Panel</a>, <ahref="#Shape-enum">StyledPanel</a>, <ahref="#Shape-enum">PopupPanel</a>, <ahref="#Shape-enum">WinPanel</a>, <ahref="#Shape-enum">ToolBarPanel</a>, <ahref="#Shape-enum">MenuBarPanel</a>, <ahref="#Shape-enum">HLine</a> and <ahref="#Shape-enum">VLine</a>; the shadow styles are <ahref="#Shadow-enum">Plain</a>, <ahref="#Shadow-enum">Raised</a> and
<ahref="#Shadow-enum">Sunken</a>.
<p> The line width is the width of the frame border.
<p> The mid-line width specifies the width of an extra line in the
middle of the frame, which uses a third color to obtain a special
3D effect. Notice that a mid-line is only drawn for <ahref="#Shape-enum">Box</a>, <ahref="#Shape-enum">HLine</a> and <ahref="#Shape-enum">VLine</a> frames that are raised or sunken.
<p> The margin is the gap between the frame and the contents of the
frame.
<p><aname="picture"></a>
This table shows the most useful combinations of styles and widths
(and some rather useless ones):
<p><center><imgsrc="frames.png"alt="Table of frame styles"></center><p>See also <ahref="abstractwidgets.html">Abstract Widget Classes</a>.
<p> This enum type defines the shapes of a QFrame's frame.
<ul>
<li><tt>QFrame::NoFrame</tt> - QFrame draws nothing
<li><tt>QFrame::Box</tt> - QFrame draws a box around its contents
<li><tt>QFrame::Panel</tt> - QFrame draws a panel to make the contents appear
raised or sunken
<li><tt>QFrame::StyledPanel</tt> - draws a rectangular panel with a look that
depends on the current GUI style. It can be raised or sunken.
<li><tt>QFrame::HLine</tt> - QFrame draws a horizontal line that frames nothing
(useful as separator)
<li><tt>QFrame::VLine</tt> - QFrame draws a vertical line that frames nothing
(useful as separator)
<li><tt>QFrame::GroupBoxPanel</tt> - draws a rectangular panel
<li><tt>QFrame::WinPanel</tt> - draws a rectangular panel that can be raised or
sunken like those in Windows 95. Specifying this shape sets
the line width to 2 pixels. WinPanel is provided for compatibility.
For GUI style independence we recommend using StyledPanel instead.
<li><tt>QFrame::ToolBarPanel</tt>
<li><tt>QFrame::MenuBarPanel</tt>
<li><tt>QFrame::PopupPanel</tt>
<li><tt>QFrame::LineEditPanel</tt> - is used to draw a frame suitable for line edits. The
look depends upon the current GUI style.
<li><tt>QFrame::TabWidgetPanel</tt> - is used to draw a frame suitable for tab widgets. The
look depends upon the current GUI style.
<li><tt>QFrame::MShape</tt> - internal mask
</ul><p> When it does not call <ahref="qstyle.html">QStyle</a>, Shape interacts with QFrame::Shadow,
the <ahref="#lineWidth">lineWidth</a>() and the <ahref="#midLineWidth">midLineWidth</a>() to create the total result.
See the <ahref="#picture">picture of the frames</a> in the class
description.
<p><p>See also <ahref="#Shadow-enum">QFrame::Shadow</a>, <ahref="qwidget.html#style">QFrame::style</a>(), and <ahref="qstyle.html#drawPrimitive">QStyle::drawPrimitive</a>().
Virtual function that draws the contents of the frame.
<p> The <ahref="qpainter.html">QPainter</a> is already open when you get it, and you must leave
it open. Painter <ahref="qpainter.html#setWorldMatrix">transformations</a> are switched off on entry. If you
transform the painter, remember to take the frame into account and
<ahref="qpainter.html#resetXForm">reset transformation</a> before
returning.
<p> This function is reimplemented by subclasses that draw something
inside the frame. It should only draw inside <ahref="#contentsRect">contentsRect</a>(). The
default function does nothing.
<p><p>See also <ahref="#contentsRect-prop">contentsRect</a> and <ahref="qpainter.html#setClipRect">QPainter::setClipRect</a>().
<p>Reimplemented in <ahref="qlabel.html#drawContents">QLabel</a>, <ahref="qlcdnumber.html#drawContents">QLCDNumber</a>, <ahref="qmenubar.html#drawContents">QMenuBar</a>, and <ahref="qpopupmenu.html#drawContents">QPopupMenu</a>.
Draws the frame using the painter <em>p</em> and the current frame
attributes and color group. The rectangle inside the frame is not
affected.
<p> This function is virtual, but in general you do not need to
reimplement it. If you do, note that the <ahref="qpainter.html">QPainter</a> is already open
and must remain open.
<p><p>See also <ahref="#frameRect-prop">frameRect</a>, <ahref="#contentsRect-prop">contentsRect</a>, <ahref="#drawContents">drawContents</a>(), <ahref="#frameStyle">frameStyle</a>(), and <ahref="qwidget.html#palette-prop">palette</a>.
<p> The <em>style</em> is the bitwise OR between a frame shape and a frame
shadow style. See the <ahref="#picture">illustration</a> in the
class documentation.
<p> The frame shapes are given in <ahref="#Shape-enum">QFrame::Shape</a> and the shadow
styles in <ahref="#Shadow-enum">QFrame::Shadow</a>.
<p> If a mid-line width greater than 0 is specified, an additional
line is drawn for <ahref="#Shadow-enum">Raised</a> or <ahref="#Shadow-enum">Sunken</a><ahref="#Shape-enum">Box</a>, <ahref="#Shape-enum">HLine</a>, and <ahref="#Shape-enum">VLine</a> frames. The mid-color of the current color group is used for
drawing middle lines.
<p><p>See also <ahref="#picture">Illustration</a>, <ahref="#frameStyle">frameStyle</a>(), <ahref="qwidget.html#colorGroup-prop">colorGroup</a>, and <ahref="qcolorgroup.html">QColorGroup</a>.
<p>Examples: <ahref="cursor-example.html#x1114">cursor/cursor.cpp</a>, <ahref="layout-example.html#x531">layout/layout.cpp</a>, <ahref="listboxcombo-example.html#x1401">listboxcombo/listboxcombo.cpp</a>, <ahref="rangecontrols-example.html#x1381">rangecontrols/rangecontrols.cpp</a>, <ahref="scrollview-example.html#x626">scrollview/scrollview.cpp</a>, <ahref="tabdialog-example.html#x52">tabdialog/tabdialog.cpp</a>, and <ahref="tictac-example.html#x24">tictac/tictac.cpp</a>.
<h3class=fn>void <aname="setLineWidth"></a>QFrame::setLineWidth ( int )<tt> [virtual]</tt>
</h3><p>Sets the line width.
See the <ahref="qframe.html#lineWidth-prop">"lineWidth"</a> property for details.
<h3class=fn>void <aname="setMargin"></a>QFrame::setMargin ( int )<tt> [virtual]</tt>
</h3><p>Sets the width of the margin.
See the <ahref="qframe.html#margin-prop">"margin"</a> property for details.
<h3class=fn>void <aname="setMidLineWidth"></a>QFrame::setMidLineWidth ( int )<tt> [virtual]</tt>
</h3><p>Sets the width of the mid-line.
See the <ahref="qframe.html#midLineWidth-prop">"midLineWidth"</a> property for details.
<p>This property holds the frame shadow value from the frame style.
<p>Set this property's value with <ahref="#setFrameShadow">setFrameShadow</a>() and get this property's value with <ahref="#frameShadow">frameShadow</a>().
<p><p>See also <ahref="#frameStyle">frameStyle</a>() and <ahref="#frameShape-prop">frameShape</a>.
<p>This property holds the frame shape value from the frame style.
<p>Set this property's value with <ahref="#setFrameShape">setFrameShape</a>() and get this property's value with <ahref="#frameShape">frameShape</a>().
<p><p>See also <ahref="#frameStyle">frameStyle</a>() and <ahref="#frameShadow-prop">frameShadow</a>.
<p>This property holds the width of the frame that is drawn.
<p>Note that the frame width depends on the <ahref="#setFrameStyle">frame style</a>, not only the line
width and the mid-line width. For example, the style <ahref="#Shape-enum">NoFrame</a>
always has a frame width of 0, whereas the style <ahref="#Shape-enum">Panel</a> has a
frame width equivalent to the line width. The frame width also
includes the margin.
<p><p>See also <ahref="#lineWidth-prop">lineWidth</a>, <ahref="#midLineWidth-prop">midLineWidth</a>, <ahref="#frameStyle">frameStyle</a>(), and <ahref="#margin-prop">margin</a>.
<p>Get this property's value with <ahref="#frameWidth">frameWidth</a>().
<p><p>See also <ahref="#lineWidth-prop">lineWidth</a> and <ahref="#frameWidth-prop">frameWidth</a>.
<p>Set this property's value with <ahref="#setMidLineWidth">setMidLineWidth</a>() and get this property's value with <ahref="#midLineWidth">midLineWidth</a>().
<!-- eof -->
<hr><p>
This file is part of the <ahref="index.html">Qt toolkit</a>.