![]() |
Home · Overviews · Examples | ![]() |
The QFrame class is the base class of widgets that can have a frame. More...
Inherits QWidget.
Inherited by QAbstractScrollArea, QLabel, QLCDNumber, QSplitter, QStackedWidget, and QToolBox.
The QFrame class is the base class of widgets that can have a frame.
QMenu uses this to "raise" the menu above the surrounding screen. QProgressBar has a "sunken" look. QLabel has a flat look. The frames of widgets like these can be changed.
QLabel label(...); label.setFrameStyle(QFrame::Panel | QFrame::Raised); label.setLineWidth(2); QProgressBar pbar(...); label.setFrameStyle(QFrame::NoFrame);
The QFrame class can also be used directly for creating simple placeholder frames without any contents.
The frame style is specified by a frame shape and a shadow style that is used to visually separate the frame from surrounding widgets. These properties can be set together using the setFrameStyle function and read with frameStyle.
The frame shapes are NoFrame, Box, Panel, StyledPanel, HLine and VLine; the shadow styles are Plain, Raised and Sunken.
A frame widget has three attributes that describe the thickness of the border: lineWidth, midLineWidth, and frameWidth.
The margin between the frame and the contents of the frame can be customized with the QWidget::setContentsMargins() function.
This table shows some of the combinations of styles and line widths:
Copyright © 2008 Trolltech | Trademarks | Qt Jambi 4.3.4_01 |