The QFrame class is the base class of widgets that have an (optional) frame. (details) (complete member list)
#include <qframe.h>
Inherits QWidget.
Inherited by QGroupBox, QLCDNumber, QLabel and QTableWidget.
The QLabel and QGroupBox widgets are examples of widgets that inherit QFrame to allow frames around these widgets. The QFrame class can also be used directly for creating simple frames without any contents.
A frame widget has a frame type, a frame style a frame width and a mid-line width.
The different frame types are NoFrame,
Box,
Panel,
HLine
and
VLine.
Notice that the two latter ones specify lines, not rectangles.
The frame styles are Plain,
Raised
and Sunken.
See setFrameStyle()
for a description of frame types and frame styles.
The frame width is the width of the frame border.
The mid-line width specifies the width of an extra line in the middle of the border, that uses a third color to get a special 3D effect.
Example of use:
QFrame *f = new QFrame;
f->setFrameStyle( QFrame::Panel | QFrame::Sunken );
Constructs a frame widget with frame style NoFrame
and 1 pixel frame width.
The parent and name arguments are passed to the QWidget constructor.
Returns the geometry of the rectangle inside the frame.
See also: frameRect().
Virtual function that draws the contents of the frame.
This function is reimplemented by subclasses that want to draw something inside the frame. Reimplemented in QLabel.
Internal function that draws the frame.
Returns the frame rectangle.
See also: setFrameRect().
Returns the frame type and style.
See also: setFrameStyle().
Returns the width of the frame that is drawn.
Returns the line width.
See also: setFrameWidth().
Returns the width of the middle line.
See also: setMidLineWidth().
Paints the frame.
Opens the painter on the frame and calls first drawFrame(), then drawContents(). Reimplemented in QGroupBox and QTableWidget.
Sets the frame rectangle to r.
If r is a null rectangle (for example QRect(0,0,0,0)
),
then the frame rectangle follows the widget rectangle (QWidget::rect()).
See also: frameRect().
Sets the frame style to style.
The style is the bitwise OR between a frame geometry style and a frame shadow style.
The geometry styles are:
NoFrame
draws nothing.
Box
draws a rectangular box.
Panel
draws a rectangular panel that can be raised or sunken.
HLine
draws a horizontal line (vertically centered).
VLine
draws a vertical line (horizontally centered).
The shadow styles are:
Plain
draws using the palette foreground color.
Raised
draws a 3D raised line using the palette light and dark colors.
Sunken
draws a 3D sunken line using the palette light and dark colors.
Raised
and Sunken
will draw an additional middle line if a mid-line
width greater than 0 was specified. The palette mid color is used for
drawing middle lines.
See also: frameStyle(), QPalette.
Sets the frame width to fw.
See also: lineWidth().
Sets the width of the middle line to mw.
See also: midLineWidth().
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: