The QFrame class is the base class of widgets that can have a frame.
.PP
It draws a frame and calls a virtual function, drawContents(), to fill in the frame. This function is reimplemented by subclasses. There are also two other less useful functions: drawFrame() and frameChanged().
TQPopupMenu uses this to "raise" the menu above the surrounding screen. QProgressBar has a "sunken" look. TQLabel has a flat look. The frames of widgets like these can be changed.
The QFrame class can also be used directly for creating simple frames without any contents, although usually you would use a QHBox or QVBox because they automatically lay out the widgets you put inside the frame.
.PP
A frame widget has four attributes: frameStyle(), lineWidth(), midLineWidth(), and margin().
.PP
The frame style is specified by a frame shape and a shadow style. The frame shapes are NoFrame, Box, Panel, StyledPanel, PopupPanel, WinPanel, ToolBarPanel, MenuBarPanel, HLine and VLine; the shadow styles are Plain, Raised and Sunken.
.PP
The line width is the width of the frame border.
.PP
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 Box, HLine and VLine frames that are raised or sunken.
.PP
The margin is the gap between the frame and the contents of the frame.
.PP
This table shows the most useful combinations of styles and widths (and some rather useless ones):
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center>
.PP
See also Abstract Widget Classes.
.SS "Member Type Documentation"
.SH "QFrame::Shadow"
This enum type defines the 3D effect used for QFrame's frame.
.TP
\fCQFrame::Plain\fR - the frame and contents appear level with the surroundings; draws using the palette foreground color (without any 3D effect)
.TP
\fCQFrame::Raised\fR - the frame and contents appear raised; draws a 3D raised line using the light and dark colors of the current color group
.TP
\fCQFrame::Sunken\fR - the frame and contents appear sunken; draws a 3D sunken line using the light and dark colors of the current color group
.TP
\fCQFrame::MShadow\fR - internal; mask for the shadow
.PP
Shadow interacts with QFrame::Shape, the lineWidth() and the midLineWidth(). See the picture of the frames in the class description.
.PP
See also QFrame::Shape, lineWidth, and midLineWidth.
.SH "QFrame::Shape"
This enum type defines the shapes of a QFrame's frame.
.TP
\fCQFrame::NoFrame\fR - QFrame draws nothing
.TP
\fCQFrame::Box\fR - QFrame draws a box around its contents
.TP
\fCQFrame::Panel\fR - QFrame draws a panel to make the contents appear raised or sunken
.TP
\fCQFrame::StyledPanel\fR - draws a rectangular panel with a look that depends on the current GUI style. It can be raised or sunken.
.TP
\fCQFrame::HLine\fR - QFrame draws a horizontal line that frames nothing (useful as separator)
.TP
\fCQFrame::VLine\fR - QFrame draws a vertical line that frames nothing (useful as separator)
.TP
\fCQFrame::GroupBoxPanel\fR - draws a rectangular panel
.TP
\fCQFrame::WinPanel\fR - 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.
.TP
\fCQFrame::ToolBarPanel\fR
.TP
\fCQFrame::MenuBarPanel\fR
.TP
\fCQFrame::PopupPanel\fR
.TP
\fCQFrame::LineEditPanel\fR - is used to draw a frame suitable for line edits. The look depends upon the current GUI style.
.TP
\fCQFrame::TabWidgetPanel\fR - is used to draw a frame suitable for tab widgets. The look depends upon the current GUI style.
When it does not call TQStyle, Shape interacts with QFrame::Shadow, the lineWidth() and the midLineWidth() to create the total result. See the picture of the frames in the class description.
The TQPainter is already open when you get it, and you must leave it open. Painter transformations are switched off on entry. If you transform the painter, remember to take the frame into account and reset transformation before returning.
This function is reimplemented by subclasses that draw something inside the frame. It should only draw inside contentsRect(). The default function does nothing.
Sets the frame rectangle. See the "frameRect" property for details.
.SH "void QFrame::setFrameShadow ( Shadow )"
Sets the frame shadow value from the frame style. See the "frameShadow" property for details.
.SH "void QFrame::setFrameShape ( Shape )"
Sets the frame shape value from the frame style. See the "frameShape" property for details.
.SH "void QFrame::setFrameStyle ( int style )\fC [virtual]\fR"
Sets the frame style to \fIstyle\fR.
.PP
The \fIstyle\fR is the bitwise OR between a frame shape and a frame shadow style. See the illustration in the class documentation.
.PP
The frame shapes are given in QFrame::Shape and the shadow styles in QFrame::Shadow.
.PP
If a mid-line width greater than 0 is specified, an additional line is drawn for Raised or Sunken Box, HLine, and VLine frames. The mid-color of the current color group is used for drawing middle lines.
The frame rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting this property does \fInot\fR cause a widget update.
Set this property's value with setFrameRect() and get this property's value with frameRect().
.SH "Shadow frameShadow"
This property holds the frame shadow value from the frame style.
.PP
Set this property's value with setFrameShadow() and get this property's value with frameShadow().
.PP
See also frameStyle() and frameShape.
.SH "Shape frameShape"
This property holds the frame shape value from the frame style.
.PP
Set this property's value with setFrameShape() and get this property's value with frameShape().
.PP
See also frameStyle() and frameShadow.
.SH "int frameWidth"
This property holds the width of the frame that is drawn.
.PP
Note that the frame width depends on the frame style, not only the line width and the mid-line width. For example, the style NoFrame always has a frame width of 0, whereas the style Panel has a frame width equivalent to the line width. The frame width also includes the margin.
.PP
See also lineWidth, midLineWidth, frameStyle(), and margin.
.PP
Get this property's value with frameWidth().
.SH "int lineWidth"
This property holds the line width.
.PP
Note that the \fItotal\fR line width for HLine and VLine is given by frameWidth(), not lineWidth().
.PP
The default value is 1.
.PP
See also midLineWidth and frameWidth.
.PP
Set this property's value with setLineWidth() and get this property's value with lineWidth().
.SH "int margin"
This property holds the width of the margin.
.PP
The margin is the distance between the innermost pixel of the frame and the outermost pixel of contentsRect(). It is included in frameWidth().
.PP
The margin is filled according to backgroundMode().
.PP
The default value is 0.
.PP
See also margin, lineWidth, and frameWidth.
.PP
Set this property's value with setMargin() and get this property's value with margin().
.SH "int midLineWidth"
This property holds the width of the mid-line.
.PP
The default value is 0.
.PP
See also lineWidth and frameWidth.
.PP
Set this property's value with setMidLineWidth() and get this property's value with midLineWidth().