You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
371 lines
25 KiB
371 lines
25 KiB
14 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qframe.cpp:46 -->
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>QFrame Class</title>
|
||
|
<style type="text/css"><!--
|
||
|
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 Classes</font></a>
|
||
|
| <a href="mainclasses.html">
|
||
|
<font color="#004faf">Main Classes</font></a>
|
||
|
| <a href="annotated.html">
|
||
|
<font color="#004faf">Annotated</font></a>
|
||
|
| <a href="groups.html">
|
||
|
<font color="#004faf">Grouped 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>QFrame Class Reference</h1>
|
||
|
|
||
|
<p>The QFrame class is the base class of widgets that can have a frame.
|
||
|
<a href="#details">More...</a>
|
||
|
<p><tt>#include <<a href="qframe-h.html">qframe.h</a>></tt>
|
||
|
<p>Inherits <a href="qwidget.html">QWidget</a>.
|
||
|
<p>Inherited by <a href="qgroupbox.html">QGroupBox</a>, <a href="qscrollview.html">QScrollView</a>, <a href="qdockwindow.html">QDockWindow</a>, <a href="qgrid.html">QGrid</a>, <a href="qhbox.html">QHBox</a>, <a href="qlabel.html">QLabel</a>, <a href="qlcdnumber.html">QLCDNumber</a>, <a href="qlineedit.html">QLineEdit</a>, <a href="qmenubar.html">QMenuBar</a>, <a href="qpopupmenu.html">QPopupMenu</a>, <a href="qprogressbar.html">QProgressBar</a>, <a href="qsplitter.html">QSplitter</a>, <a href="qtoolbox.html">QToolBox</a>, and <a href="qwidgetstack.html">QWidgetStack</a>.
|
||
|
<p><a href="qframe-members.html">List of all member functions.</a>
|
||
|
<h2>Public Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn><a href="#QFrame"><b>QFrame</b></a> ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )</li>
|
||
|
<li class=fn>int <a href="#frameStyle"><b>frameStyle</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#setFrameStyle"><b>setFrameStyle</b></a> ( int style )</li>
|
||
|
<li class=fn>int <a href="#frameWidth"><b>frameWidth</b></a> () const</li>
|
||
|
<li class=fn>QRect <a href="#contentsRect"><b>contentsRect</b></a> () const</li>
|
||
|
<li class=fn>enum <a href="#Shape-enum"><b>Shape</b></a> { NoFrame = 0, Box = 0x0001, Panel = 0x0002, WinPanel = 0x0003, HLine = 0x0004, VLine = 0x0005, StyledPanel = 0x0006, PopupPanel = 0x0007, MenuBarPanel = 0x0008, ToolBarPanel = 0x0009, LineEditPanel = 0x000a, TabWidgetPanel = 0x000b, GroupBoxPanel = 0x000c, MShape = 0x000f }</li>
|
||
|
<li class=fn>enum <a href="#Shadow-enum"><b>Shadow</b></a> { Plain = 0x0010, Raised = 0x0020, Sunken = 0x0030, MShadow = 0x00f0 }</li>
|
||
|
<li class=fn>Shape <a href="#frameShape"><b>frameShape</b></a> () const</li>
|
||
|
<li class=fn>void <a href="#setFrameShape"><b>setFrameShape</b></a> ( Shape )</li>
|
||
|
<li class=fn>Shadow <a href="#frameShadow"><b>frameShadow</b></a> () const</li>
|
||
|
<li class=fn>void <a href="#setFrameShadow"><b>setFrameShadow</b></a> ( Shadow )</li>
|
||
|
<li class=fn>int <a href="#lineWidth"><b>lineWidth</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#setLineWidth"><b>setLineWidth</b></a> ( int )</li>
|
||
|
<li class=fn>int <a href="#margin"><b>margin</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#setMargin"><b>setMargin</b></a> ( int )</li>
|
||
|
<li class=fn>int <a href="#midLineWidth"><b>midLineWidth</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#setMidLineWidth"><b>setMidLineWidth</b></a> ( int )</li>
|
||
|
<li class=fn>QRect <a href="#frameRect"><b>frameRect</b></a> () const</li>
|
||
|
<li class=fn>virtual void <a href="#setFrameRect"><b>setFrameRect</b></a> ( const QRect & )</li>
|
||
|
</ul>
|
||
|
<h2>Properties</h2>
|
||
|
<ul>
|
||
|
<li class=fn>QRect <a href="#contentsRect-prop"><b>contentsRect</b></a> - the rectangle inside the frame <em>(read only)</em></li>
|
||
|
<li class=fn>QRect <a href="#frameRect-prop"><b>frameRect</b></a> - the frame rectangle</li>
|
||
|
<li class=fn>Shadow <a href="#frameShadow-prop"><b>frameShadow</b></a> - the frame shadow value from the frame style</li>
|
||
|
<li class=fn>Shape <a href="#frameShape-prop"><b>frameShape</b></a> - the frame shape value from the frame style</li>
|
||
|
<li class=fn>int <a href="#frameWidth-prop"><b>frameWidth</b></a> - the width of the frame that is drawn <em>(read only)</em></li>
|
||
|
<li class=fn>int <a href="#lineWidth-prop"><b>lineWidth</b></a> - the line width</li>
|
||
|
<li class=fn>int <a href="#margin-prop"><b>margin</b></a> - the width of the margin</li>
|
||
|
<li class=fn>int <a href="#midLineWidth-prop"><b>midLineWidth</b></a> - the width of the mid-line</li>
|
||
|
</ul>
|
||
|
<h2>Protected Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn>virtual void <a href="#paintEvent"><b>paintEvent</b></a> ( QPaintEvent * event )</li>
|
||
|
<li class=fn>virtual void <a href="#resizeEvent"><b>resizeEvent</b></a> ( QResizeEvent * e )</li>
|
||
|
<li class=fn>virtual void <a href="#drawFrame"><b>drawFrame</b></a> ( QPainter * p )</li>
|
||
|
<li class=fn>virtual void <a href="#drawContents"><b>drawContents</b></a> ( QPainter * )</li>
|
||
|
<li class=fn>virtual void <a href="#frameChanged"><b>frameChanged</b></a> ()</li>
|
||
|
</ul>
|
||
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
||
|
|
||
|
|
||
|
The QFrame class is the base class of widgets that can have a frame.
|
||
|
<p>
|
||
|
<p> It draws a frame and calls a virtual function, <a href="#drawContents">drawContents</a>(), to
|
||
|
fill in the frame. This function is reimplemented by subclasses.
|
||
|
There are also two other less useful functions: <a href="#drawFrame">drawFrame</a>() and
|
||
|
<a href="#frameChanged">frameChanged</a>().
|
||
|
<p> <a href="qpopupmenu.html">QPopupMenu</a> uses this to "raise" the menu above the surrounding
|
||
|
screen. <a href="qprogressbar.html">QProgressBar</a> has a "sunken" look. <a href="qlabel.html">QLabel</a> has a flat look.
|
||
|
The frames of widgets like these can be changed.
|
||
|
<p> <pre>
|
||
|
<a href="qlabel.html">QLabel</a> label(...);
|
||
|
label.<a href="#setFrameStyle">setFrameStyle</a>( QFrame::<a href="#Shape-enum">Panel</a> | QFrame::<a href="#Shadow-enum">Raised</a> );
|
||
|
label.<a href="#setLineWidth">setLineWidth</a>( 2 );
|
||
|
|
||
|
<a href="qprogressbar.html">QProgressBar</a> pbar(...);
|
||
|
label.<a href="#setFrameStyle">setFrameStyle</a>( QFrame::<a href="#Shape-enum">NoFrame</a> );
|
||
|
</pre>
|
||
|
|
||
|
<p> The QFrame class can also be used directly for creating simple
|
||
|
frames without any contents, although usually you would use a
|
||
|
<a href="qhbox.html">QHBox</a> or <a href="qvbox.html">QVBox</a> because they automatically lay out the widgets you
|
||
|
put inside the frame.
|
||
|
<p> A frame widget has four attributes: <a href="#frameStyle">frameStyle</a>(), <a href="#lineWidth">lineWidth</a>(),
|
||
|
<a href="#midLineWidth">midLineWidth</a>(), and <a href="#margin">margin</a>().
|
||
|
<p> The frame style is specified by a <a href="#Shape-enum">frame
|
||
|
shape</a> and a <a href="#Shadow-enum">shadow style</a>. The
|
||
|
frame shapes are <a href="#Shape-enum">NoFrame</a>, <a href="#Shape-enum">Box</a>, <a href="#Shape-enum">Panel</a>, <a href="#Shape-enum">StyledPanel</a>, <a href="#Shape-enum">PopupPanel</a>, <a href="#Shape-enum">WinPanel</a>, <a href="#Shape-enum">ToolBarPanel</a>, <a href="#Shape-enum">MenuBarPanel</a>, <a href="#Shape-enum">HLine</a> and <a href="#Shape-enum">VLine</a>; the shadow styles are <a href="#Shadow-enum">Plain</a>, <a href="#Shadow-enum">Raised</a> and
|
||
|
<a href="#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 <a href="#Shape-enum">Box</a>, <a href="#Shape-enum">HLine</a> and <a href="#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> <a name="picture"></a>
|
||
|
This table shows the most useful combinations of styles and widths
|
||
|
(and some rather useless ones):
|
||
|
<p> <center><img src="frames.png" alt="Table of frame styles"></center> <p>See also <a href="abstractwidgets.html">Abstract Widget Classes</a>.
|
||
|
|
||
|
<hr><h2>Member Type Documentation</h2>
|
||
|
<h3 class=fn><a name="Shadow-enum"></a>QFrame::Shadow</h3>
|
||
|
|
||
|
<p> This enum type defines the 3D effect used for QFrame's frame.
|
||
|
<ul>
|
||
|
<li><tt>QFrame::Plain</tt> - the frame and contents appear level with the
|
||
|
surroundings; draws using the palette foreground color (without
|
||
|
any 3D effect)
|
||
|
<li><tt>QFrame::Raised</tt> - the frame and contents appear raised; draws a 3D
|
||
|
raised line using the light and dark colors of the current color
|
||
|
group
|
||
|
<li><tt>QFrame::Sunken</tt> - the frame and contents appear sunken; draws a 3D
|
||
|
sunken line using the light and dark colors of the current color
|
||
|
group
|
||
|
<li><tt>QFrame::MShadow</tt> - internal; mask for the shadow
|
||
|
</ul><p> Shadow interacts with QFrame::Shape, the <a href="#lineWidth">lineWidth</a>() and the
|
||
|
<a href="#midLineWidth">midLineWidth</a>(). See the <a href="#picture">picture of the frames</a>
|
||
|
in the class description.
|
||
|
<p> <p>See also <a href="#Shape-enum">QFrame::Shape</a>, <a href="#lineWidth-prop">lineWidth</a>, and <a href="#midLineWidth-prop">midLineWidth</a>.
|
||
|
|
||
|
<h3 class=fn><a name="Shape-enum"></a>QFrame::Shape</h3>
|
||
|
|
||
|
<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 <a href="qstyle.html">QStyle</a>, Shape interacts with QFrame::Shadow,
|
||
|
the <a href="#lineWidth">lineWidth</a>() and the <a href="#midLineWidth">midLineWidth</a>() to create the total result.
|
||
|
See the <a href="#picture">picture of the frames</a> in the class
|
||
|
description.
|
||
|
<p> <p>See also <a href="#Shadow-enum">QFrame::Shadow</a>, <a href="qwidget.html#style">QFrame::style</a>(), and <a href="qstyle.html#drawPrimitive">QStyle::drawPrimitive</a>().
|
||
|
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
|
<h3 class=fn><a name="QFrame"></a>QFrame::QFrame ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, WFlags f = 0 )
|
||
|
</h3>
|
||
|
Constructs a frame widget with frame style <a href="#Shape-enum">NoFrame</a> and a
|
||
|
1-pixel frame width.
|
||
|
<p> The <em>parent</em>, <em>name</em> and <em>f</em> arguments are passed to the
|
||
|
<a href="qwidget.html">QWidget</a> constructor.
|
||
|
|
||
|
<h3 class=fn><a href="qrect.html">QRect</a> <a name="contentsRect"></a>QFrame::contentsRect () const
|
||
|
</h3><p>Returns the rectangle inside the frame.
|
||
|
See the <a href="qframe.html#contentsRect-prop">"contentsRect"</a> property for details.
|
||
|
<h3 class=fn>void <a name="drawContents"></a>QFrame::drawContents ( <a href="qpainter.html">QPainter</a> * )<tt> [virtual protected]</tt>
|
||
|
</h3>
|
||
|
Virtual function that draws the contents of the frame.
|
||
|
<p> The <a href="qpainter.html">QPainter</a> is already open when you get it, and you must leave
|
||
|
it open. Painter <a href="qpainter.html#setWorldMatrix">transformations</a> are switched off on entry. If you
|
||
|
transform the painter, remember to take the frame into account and
|
||
|
<a href="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 <a href="#contentsRect">contentsRect</a>(). The
|
||
|
default function does nothing.
|
||
|
<p> <p>See also <a href="#contentsRect-prop">contentsRect</a> and <a href="qpainter.html#setClipRect">QPainter::setClipRect</a>().
|
||
|
|
||
|
<p>Reimplemented in <a href="qlabel.html#drawContents">QLabel</a>, <a href="qlcdnumber.html#drawContents">QLCDNumber</a>, <a href="qmenubar.html#drawContents">QMenuBar</a>, and <a href="qpopupmenu.html#drawContents">QPopupMenu</a>.
|
||
|
<h3 class=fn>void <a name="drawFrame"></a>QFrame::drawFrame ( <a href="qpainter.html">QPainter</a> * p )<tt> [virtual protected]</tt>
|
||
|
</h3>
|
||
|
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 <a href="qpainter.html">QPainter</a> is already open
|
||
|
and must remain open.
|
||
|
<p> <p>See also <a href="#frameRect-prop">frameRect</a>, <a href="#contentsRect-prop">contentsRect</a>, <a href="#drawContents">drawContents</a>(), <a href="#frameStyle">frameStyle</a>(), and <a href="qwidget.html#palette-prop">palette</a>.
|
||
|
|
||
|
<h3 class=fn>void <a name="frameChanged"></a>QFrame::frameChanged ()<tt> [virtual protected]</tt>
|
||
|
</h3>
|
||
|
Virtual function that is called when the frame style, line width
|
||
|
or mid-line width changes.
|
||
|
<p> This function can be reimplemented by subclasses that need to know
|
||
|
when the frame attributes change.
|
||
|
<p> The default implementation calls <a href="qwidget.html#update">update</a>().
|
||
|
|
||
|
<h3 class=fn><a href="qrect.html">QRect</a> <a name="frameRect"></a>QFrame::frameRect () const
|
||
|
</h3><p>Returns the frame rectangle.
|
||
|
See the <a href="qframe.html#frameRect-prop">"frameRect"</a> property for details.
|
||
|
<h3 class=fn><a href="qframe.html#Shadow-enum">Shadow</a> <a name="frameShadow"></a>QFrame::frameShadow () const
|
||
|
</h3><p>Returns the frame shadow value from the frame style.
|
||
|
See the <a href="qframe.html#frameShadow-prop">"frameShadow"</a> property for details.
|
||
|
<h3 class=fn><a href="qframe.html#Shape-enum">Shape</a> <a name="frameShape"></a>QFrame::frameShape () const
|
||
|
</h3><p>Returns the frame shape value from the frame style.
|
||
|
See the <a href="qframe.html#frameShape-prop">"frameShape"</a> property for details.
|
||
|
<h3 class=fn>int <a name="frameStyle"></a>QFrame::frameStyle () const
|
||
|
</h3>
|
||
|
|
||
|
<p> Returns the frame style.
|
||
|
<p> The default value is QFrame::NoFrame.
|
||
|
<p> <p>See also <a href="#setFrameStyle">setFrameStyle</a>(), <a href="#frameShape-prop">frameShape</a>, and <a href="#frameShadow-prop">frameShadow</a>.
|
||
|
|
||
|
<p>Example: <a href="scrollview-example.html#x622">scrollview/scrollview.cpp</a>.
|
||
|
<h3 class=fn>int <a name="frameWidth"></a>QFrame::frameWidth () const
|
||
|
</h3><p>Returns the width of the frame that is drawn.
|
||
|
See the <a href="qframe.html#frameWidth-prop">"frameWidth"</a> property for details.
|
||
|
<h3 class=fn>int <a name="lineWidth"></a>QFrame::lineWidth () const
|
||
|
</h3><p>Returns the line width.
|
||
|
See the <a href="qframe.html#lineWidth-prop">"lineWidth"</a> property for details.
|
||
|
<h3 class=fn>int <a name="margin"></a>QFrame::margin () const
|
||
|
</h3><p>Returns the width of the margin.
|
||
|
See the <a href="qframe.html#margin-prop">"margin"</a> property for details.
|
||
|
<h3 class=fn>int <a name="midLineWidth"></a>QFrame::midLineWidth () const
|
||
|
</h3><p>Returns the width of the mid-line.
|
||
|
See the <a href="qframe.html#midLineWidth-prop">"midLineWidth"</a> property for details.
|
||
|
<h3 class=fn>void <a name="paintEvent"></a>QFrame::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * event )<tt> [virtual protected]</tt>
|
||
|
</h3>
|
||
|
Processes the paint event <em>event</em>.
|
||
|
<p> Paints the frame and the contents.
|
||
|
<p> Opens the painter on the frame and calls <a href="#drawFrame">drawFrame</a>(), then
|
||
|
<a href="#drawContents">drawContents</a>().
|
||
|
|
||
|
<p>Examples: <a href="life-example.html#x1888">life/life.cpp</a> and <a href="qfd-example.html#x1995">qfd/fontdisplayer.cpp</a>.
|
||
|
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget</a>.
|
||
|
<h3 class=fn>void <a name="resizeEvent"></a>QFrame::resizeEvent ( <a href="qresizeevent.html">QResizeEvent</a> * e )<tt> [virtual protected]</tt>
|
||
|
</h3>
|
||
|
Processes the resize event <em>e</em>.
|
||
|
<p> Adjusts the frame rectangle for the resized widget. The frame
|
||
|
rectangle is elastic, and the surrounding area is static.
|
||
|
<p> The resulting frame rectangle may be null or invalid. You can use
|
||
|
<a href="qwidget.html#setMinimumSize">setMinimumSize</a>() to avoid those possibilities.
|
||
|
<p> Nothing is done if the frame rectangle is a <a href="qrect.html#isNull">null rectangle</a> already.
|
||
|
|
||
|
<p>Example: <a href="life-example.html#x1889">life/life.cpp</a>.
|
||
|
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget</a>.
|
||
|
<h3 class=fn>void <a name="setFrameRect"></a>QFrame::setFrameRect ( const <a href="qrect.html">QRect</a> & )<tt> [virtual]</tt>
|
||
|
</h3><p>Sets the frame rectangle.
|
||
|
See the <a href="qframe.html#frameRect-prop">"frameRect"</a> property for details.
|
||
|
<h3 class=fn>void <a name="setFrameShadow"></a>QFrame::setFrameShadow ( <a href="qframe.html#Shadow-enum">Shadow</a> )
|
||
|
</h3><p>Sets the frame shadow value from the frame style.
|
||
|
See the <a href="qframe.html#frameShadow-prop">"frameShadow"</a> property for details.
|
||
|
<h3 class=fn>void <a name="setFrameShape"></a>QFrame::setFrameShape ( <a href="qframe.html#Shape-enum">Shape</a> )
|
||
|
</h3><p>Sets the frame shape value from the frame style.
|
||
|
See the <a href="qframe.html#frameShape-prop">"frameShape"</a> property for details.
|
||
|
<h3 class=fn>void <a name="setFrameStyle"></a>QFrame::setFrameStyle ( int style )<tt> [virtual]</tt>
|
||
|
</h3>
|
||
|
Sets the frame style to <em>style</em>.
|
||
|
<p> The <em>style</em> is the bitwise OR between a frame shape and a frame
|
||
|
shadow style. See the <a href="#picture">illustration</a> in the
|
||
|
class documentation.
|
||
|
<p> The frame shapes are given in <a href="#Shape-enum">QFrame::Shape</a> and the shadow
|
||
|
styles in <a href="#Shadow-enum">QFrame::Shadow</a>.
|
||
|
<p> If a mid-line width greater than 0 is specified, an additional
|
||
|
line is drawn for <a href="#Shadow-enum">Raised</a> or <a href="#Shadow-enum">Sunken</a> <a href="#Shape-enum">Box</a>, <a href="#Shape-enum">HLine</a>, and <a href="#Shape-enum">VLine</a> frames. The mid-color of the current color group is used for
|
||
|
drawing middle lines.
|
||
|
<p> <p>See also <a href="#picture">Illustration</a>, <a href="#frameStyle">frameStyle</a>(), <a href="qwidget.html#colorGroup-prop">colorGroup</a>, and <a href="qcolorgroup.html">QColorGroup</a>.
|
||
|
|
||
|
<p>Examples: <a href="cursor-example.html#x1114">cursor/cursor.cpp</a>, <a href="layout-example.html#x531">layout/layout.cpp</a>, <a href="listboxcombo-example.html#x1401">listboxcombo/listboxcombo.cpp</a>, <a href="rangecontrols-example.html#x1381">rangecontrols/rangecontrols.cpp</a>, <a href="scrollview-example.html#x626">scrollview/scrollview.cpp</a>, <a href="tabdialog-example.html#x52">tabdialog/tabdialog.cpp</a>, and <a href="tictac-example.html#x24">tictac/tictac.cpp</a>.
|
||
|
<h3 class=fn>void <a name="setLineWidth"></a>QFrame::setLineWidth ( int )<tt> [virtual]</tt>
|
||
|
</h3><p>Sets the line width.
|
||
|
See the <a href="qframe.html#lineWidth-prop">"lineWidth"</a> property for details.
|
||
|
<h3 class=fn>void <a name="setMargin"></a>QFrame::setMargin ( int )<tt> [virtual]</tt>
|
||
|
</h3><p>Sets the width of the margin.
|
||
|
See the <a href="qframe.html#margin-prop">"margin"</a> property for details.
|
||
|
<h3 class=fn>void <a name="setMidLineWidth"></a>QFrame::setMidLineWidth ( int )<tt> [virtual]</tt>
|
||
|
</h3><p>Sets the width of the mid-line.
|
||
|
See the <a href="qframe.html#midLineWidth-prop">"midLineWidth"</a> property for details.
|
||
|
<hr><h2>Property Documentation</h2>
|
||
|
<h3 class=fn><a href="qrect.html">QRect</a> <a name="contentsRect-prop"></a>contentsRect</h3>
|
||
|
<p>This property holds the rectangle inside the frame.
|
||
|
<p>Get this property's value with <a href="#contentsRect">contentsRect</a>().
|
||
|
<p><p>See also <a href="#frameRect-prop">frameRect</a> and <a href="#drawContents">drawContents</a>().
|
||
|
|
||
|
<h3 class=fn><a href="qrect.html">QRect</a> <a name="frameRect-prop"></a>frameRect</h3>
|
||
|
<p>This property holds the frame rectangle.
|
||
|
<p>The frame rectangle is the rectangle the frame is drawn in. By
|
||
|
default, this is the entire widget. Setting this property does <em>not</em> cause a widget update.
|
||
|
<p> If this property is set to a null rectangle (for example
|
||
|
<tt>QRect(0, 0, 0, 0)</tt>), then the frame rectangle is equivalent to
|
||
|
the <a href="qwidget.html#rect">widget rectangle</a>.
|
||
|
<p> <p>See also <a href="#contentsRect-prop">contentsRect</a>.
|
||
|
|
||
|
<p>Set this property's value with <a href="#setFrameRect">setFrameRect</a>() and get this property's value with <a href="#frameRect">frameRect</a>().
|
||
|
<h3 class=fn><a href="qframe.html#Shadow-enum">Shadow</a> <a name="frameShadow-prop"></a>frameShadow</h3>
|
||
|
<p>This property holds the frame shadow value from the frame style.
|
||
|
<p>Set this property's value with <a href="#setFrameShadow">setFrameShadow</a>() and get this property's value with <a href="#frameShadow">frameShadow</a>().
|
||
|
<p><p>See also <a href="#frameStyle">frameStyle</a>() and <a href="#frameShape-prop">frameShape</a>.
|
||
|
|
||
|
<h3 class=fn><a href="qframe.html#Shape-enum">Shape</a> <a name="frameShape-prop"></a>frameShape</h3>
|
||
|
<p>This property holds the frame shape value from the frame style.
|
||
|
<p>Set this property's value with <a href="#setFrameShape">setFrameShape</a>() and get this property's value with <a href="#frameShape">frameShape</a>().
|
||
|
<p><p>See also <a href="#frameStyle">frameStyle</a>() and <a href="#frameShadow-prop">frameShadow</a>.
|
||
|
|
||
|
<h3 class=fn>int <a name="frameWidth-prop"></a>frameWidth</h3>
|
||
|
<p>This property holds the width of the frame that is drawn.
|
||
|
<p>Note that the frame width depends on the <a href="#setFrameStyle">frame style</a>, not only the line
|
||
|
width and the mid-line width. For example, the style <a href="#Shape-enum">NoFrame</a>
|
||
|
always has a frame width of 0, whereas the style <a href="#Shape-enum">Panel</a> has a
|
||
|
frame width equivalent to the line width. The frame width also
|
||
|
includes the margin.
|
||
|
<p> <p>See also <a href="#lineWidth-prop">lineWidth</a>, <a href="#midLineWidth-prop">midLineWidth</a>, <a href="#frameStyle">frameStyle</a>(), and <a href="#margin-prop">margin</a>.
|
||
|
|
||
|
<p>Get this property's value with <a href="#frameWidth">frameWidth</a>().
|
||
|
<h3 class=fn>int <a name="lineWidth-prop"></a>lineWidth</h3>
|
||
|
<p>This property holds the line width.
|
||
|
<p>Note that the <em>total</em> line width for <a href="#Shape-enum">HLine</a> and <a href="#Shape-enum">VLine</a> is
|
||
|
given by <a href="#frameWidth">frameWidth</a>(), not <a href="#lineWidth">lineWidth</a>().
|
||
|
<p> The default value is 1.
|
||
|
<p> <p>See also <a href="#midLineWidth-prop">midLineWidth</a> and <a href="#frameWidth-prop">frameWidth</a>.
|
||
|
|
||
|
<p>Set this property's value with <a href="#setLineWidth">setLineWidth</a>() and get this property's value with <a href="#lineWidth">lineWidth</a>().
|
||
|
<h3 class=fn>int <a name="margin-prop"></a>margin</h3>
|
||
|
<p>This property holds the width of the margin.
|
||
|
<p>The margin is the distance between the innermost pixel of the
|
||
|
frame and the outermost pixel of <a href="#contentsRect">contentsRect</a>(). It is included in
|
||
|
<a href="#frameWidth">frameWidth</a>().
|
||
|
<p> The margin is filled according to <a href="qwidget.html#backgroundMode">backgroundMode</a>().
|
||
|
<p> The default value is 0.
|
||
|
<p> <p>See also <a href="#margin-prop">margin</a>, <a href="#lineWidth-prop">lineWidth</a>, and <a href="#frameWidth-prop">frameWidth</a>.
|
||
|
|
||
|
<p>Set this property's value with <a href="#setMargin">setMargin</a>() and get this property's value with <a href="#margin">margin</a>().
|
||
|
<h3 class=fn>int <a name="midLineWidth-prop"></a>midLineWidth</h3>
|
||
|
<p>This property holds the width of the mid-line.
|
||
|
<p>The default value is 0.
|
||
|
<p> <p>See also <a href="#lineWidth-prop">lineWidth</a> and <a href="#frameWidth-prop">frameWidth</a>.
|
||
|
|
||
|
<p>Set this property's value with <a href="#setMidLineWidth">setMidLineWidth</a>() and get this property's value with <a href="#midLineWidth">midLineWidth</a>().
|
||
|
<!-- eof -->
|
||
|
<hr><p>
|
||
|
This file is part of the <a href="index.html">Qt toolkit</a>.
|
||
|
Copyright © 1995-2007
|
||
|
<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 © 2007
|
||
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
||
|
<td align=right><div align=right>Qt 3.3.8</div>
|
||
|
</table></div></address></body>
|
||
|
</html>
|