⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qframe.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
字号:
.TH QFrame 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQFrame \- The base class of widgets that (can) have a frame.SH SYNOPSIS.br.PP\fC#include <qframe.h>\fR.PPInherits QWidget..PPInherited by QGrid, QGroupBox, QHBox, QLCDNumber, QLabel, QMenuBar, QPopupMenu, QProgressBar, QScrollView, QSpinBox, QSplitter, QTableView and QWidgetStack..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQFrame\fR ( QWidget * " "parent" "=0, const char * " "name" "=0, WFlags " "f" "=0, bool = TRUE )".br.ti -1c.BI "int \fBframeStyle\fR () const".br.ti -1c.BI "virtual void \fBsetFrameStyle\fR ( int )".br.ti -1c.BI "int \fBframeWidth\fR () const".br.ti -1c.BI "QRect \fBcontentsRect\fR () const".br.ti -1c.BI "virtual QSize \fBsizeHint\fR () const".br.ti -1c.BI "virtual QSizePolicy \fBsizePolicy\fR () const".br.ti -1c.BI "enum \fBShadow\fR { Plain = 0x0010, Raised = 0x0020, Sunken = 0x0030, MShadow = 0x00f0 }".br.ti -1c.BI "Shape \fBframeShape\fR () const".br.ti -1c.BI "void \fBsetFrameShape\fR ( Shape )".br.ti -1c.BI "Shadow \fBframeShadow\fR () const".br.ti -1c.BI "void \fBsetFrameShadow\fR ( Shadow )".br.ti -1c.BI "int \fBlineWidth\fR () const".br.ti -1c.BI "virtual void \fBsetLineWidth\fR ( int )".br.ti -1c.BI "int \fBmargin\fR () const".br.ti -1c.BI "virtual void \fBsetMargin\fR ( int )".br.ti -1c.BI "int \fBmidLineWidth\fR () const".br.ti -1c.BI "virtual void \fBsetMidLineWidth\fR ( int )".br.ti -1c.BI "QRect \fBframeRect\fR () const".br.ti -1c.BI "virtual void \fBsetFrameRect\fR ( const QRect & )".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBpaintEvent\fR ( QPaintEvent * )".br.ti -1c.BI "virtual void \fBresizeEvent\fR ( QResizeEvent * )".br.ti -1c.BI "virtual void \fBdrawFrame\fR ( QPainter * )".br.ti -1c.BI "virtual void \fBdrawContents\fR ( QPainter * )".br.ti -1c.BI "virtual void \fBframeChanged\fR ()".br.ti -1c.BI "virtual void \fBupdateMask\fR ()".br.ti -1c.BI "virtual void \fBdrawFrameMask\fR ( QPainter * )".br.ti -1c.BI "virtual void \fBdrawContentsMask\fR ( QPainter * )".br.in -1c.SH DESCRIPTIONThe QFrame class is the base class of widgets that (can) have a frame..PPIt draws a frame and calls a virtual function, drawContents(), to fill in the frame. This function is reimplemented by essentially all subclasses. There are also two other less useful functions, drawFrame() and frameChanged()..PPQMenuBar uses this to "raise" the menu bar above the surrounding screen:.PP.nf.br    if ( style() == MotifStyle ) {.br        setFrameStyle( QFrame::Panel | QFrame::Raised );.br        setLineWidth( 2 );.br    } else {.br        setFrameStyle( QFrame::NoFrame );.br    }.fi.PPThe QFrame class can also be used directly for creating simple frames without any contents, for example like this:.PP.nf.br    QFrame *emptyFrame = new QFrame( parentWidget );.br    emptyFrame->setFrameStyle( QFrame::Panel | QFrame::Sunken );.br    emptyFrame->setLineWidth( 2 );.fi.PPA frame widget has three attributes: frame style, a line width and a mid-line width..PPThe frame style is specified by a frame shape and a shadow style. The frame shapes are \fCNoFrame, Box, Panel, StyledPanel WinPanel, HLine\fR and \fCVLine,\fR and the shadow styles are \fCPlain, Raised\fR and \fCSunken.\fR.PPThe line width is the width of the frame border..PPThe mid-line width specifies the width of an extra line in the middle of the frame, that uses a third color to obtain a special 3D effect. Notice that a mid-line is only drawn for \fCBox, HLine\fR and \fCVLine\fR frames that are raised or sunken..PPThis table shows the most useful combinations of styles and widths (and some rather useless ones):.PP<img src=frames.png height=422 width=520 alt="Table of frame styles">.PPFor obvious reasons, \fCNoFrame\fR isn't shown. The gray areas next to the \fCVLine\fR and \fCHLine\fR examples are there because the widgets in the illustration are taller/wider than the natural width of the lines. frameWidth() returns the natural width of the line..PPThe labels on the top and right are QLabel objects with frameStyle() \fCRaised|Panel\fR and lineWidth() 1..PPExamples:.(lxform/xform.cpp popup/popup.cpp scrollview/scrollview.cpp movies/main.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QFrame::QFrame ( QWidget * parent=0, const char * name=0, WFlags f=0, bool = TRUE )"Constructs a frame widget with frame style \fCNoFrame\fR and a 1 pixel frame width..PPThe last argument exists for compatibility with Qt 1.x; it no longer has any meaning. (In Qt 2.x, QFrame always allows the HLine and VLine styles.).PPThe \fIparent, name\fR and \fIf\fR arguments are passed to the QWidget constructor..SH "QRect QFrame::contentsRect () const"Returns the rectangle inside the frame..PPSee also: frameRect() and drawContents()..SH "void QFrame::drawContents ( QPainter * ) \fC[virtual protected]\fR"Virtual function that draws the contents of the frame..PPThe QPainter 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..PPThis function is reimplemented by subclasses that draw something inside the frame. It should draw only inside contentsRect(). The default function does nothing..PPSee also: contentsRect(), QPainter::setClipRect() and drawContentsMask()..PPReimplemented in QMenuBar, QLabel, QProgressBar and QLCDNumber..SH "void QFrame::drawContentsMask ( QPainter * ) \fC[virtual protected]\fR"Virtual function that draws the mask of the frame's contents..PPIf you reimplemented drawContents(QPainter*) and your widget should support transparency you probably have to re-implement this function as well..PPThe default implementation is empty..PPSee also: drawContents(), updateMask(), QWidget::setAutoMask(), contentsRect() and QPainter::setClipRect()..PPReimplemented in QLabel and QProgressBar..SH "void QFrame::drawFrame ( QPainter * p ) \fC[virtual protected]\fR"Draws the frame using the current frame attributes and color group. The rectangle inside the frame is not affected..PPThis function is virtual, but in general you do not need to reimplement it. If you do, note that the QPainter is already open and must remain open..PPSee also: frameRect(), contentsRect(), drawContents(), frameStyle(), setPalette() and drawFrameMask()..SH "void QFrame::drawFrameMask ( QPainter * p ) \fC[virtual protected]\fR"Virtual function that draws the mask of the frame's frame..PPIf you reimplemented drawFrame(QPainter*) and your widget should support transparency you probably have to re-implement this function as well..PPThe default implementation is empty..PPSee also: drawFrame(), updateMask(), QWidget::setAutoMask() and QPainter::setClipRect()..SH "void QFrame::frameChanged () \fC[virtual protected]\fR"Virtual function that is called when the frame style, line width or mid-line width changes..PPThis function can be reimplemented by subclasses that need to know when the frame attributes change..PPThe default implementation calls update()..PPReimplemented in QHBox, QWidgetStack, QScrollView and QGrid..SH "QRect QFrame::frameRect () const"Returns the frame rectangle..PPThe default frame rectangle is equivalent to the widget rectangle..PPSee also: setFrameRect()..SH "Shadow QFrame::frameShadow () const"Returns the frame shadow value from the frame style..PPSee also: setFrameShadow(), frameStyle() and frameShape()..SH "Shape QFrame::frameShape () const"Returns the frame shape value from the frame style..PPSee also: setFrameShape(), frameStyle() and frameShadow()..SH "int QFrame::frameStyle () const"Returns the frame style..PPThe default value is QFrame::NoFrame..PPSee also: setFrameStyle(), frameShape() and frameShadow()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "int QFrame::frameWidth () const"Returns the width of the frame that is drawn..PPNote that the frame width depends on the frame style, not only the line width and the mid line width. For example, the style \fCNoFrame\fR always has a frame width 0, while the style \fCPanel\fR has a frame width equivalent to the line width. The frame width also includes the margin..PPSee also: lineWidth(), midLineWidth(), frameStyle() and margin()..SH "int QFrame::lineWidth () const"Returns the line width. (Note that the \fItotal\fR line width for \fCHLine\fR and \fCVLine\fR is given by frameWidth(), not lineWidth().).PPThe default value is 1..PPSee also: setLineWidth(), midLineWidth() and frameWidth()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "int QFrame::margin () const"Returns the width of the margin. The margin is the distance between the innermost pixel of the frame and the outermost pixel of contentsRect(). It is included in frameWidth()..PPThe margin is filled according to backgroundMode()..PPThe default value is 0..PPSee also: setMargin(), lineWidth() and frameWidth()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "int QFrame::midLineWidth () const"Returns the width of the mid-line..PPThe default value is 0..PPSee also: setMidLineWidth(), lineWidth() and frameWidth()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "void QFrame::paintEvent ( QPaintEvent * event ) \fC[virtual protected]\fR"Handles paint events for the frame..PPPaints the frame and the contents..PPOpens the painter on the frame and calls first drawFrame(), then drawContents()..PPReimplemented from QWidget..SH "void QFrame::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Handles resize events for the frame..PPAdjusts the frame rectangle for the resized widget. The frame rectangle is elastic, the surrounding area is static..PPThe resulting frame rectangle may be null or invalid. You can use setMinimumSize() to avoid that possibility..PPNothing is done if the frame rectangle is a null rectangle already..PPReimplemented from QWidget..SH "void QFrame::setFrameRect ( const QRect & r ) \fC[virtual]\fR"Sets the frame rectangle to \fIr.\fR.PPThe frame rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Calling setFrameRect() does \fInot\fR cause a widget update..PPIf \fIr\fR is a null rectangle (for example \fCQRect(0,0,0,0)\fR), then the frame rectangle is equivalent to the widget rectangle..PPSee also: frameRect() and contentsRect()..PPReimplemented in QWidgetStack..SH "void QFrame::setFrameStyle ( int style ) \fC[virtual]\fR"Sets the frame style to \fIstyle.\fR.PPThe \fIstyle\fR is the bitwise OR between a frame shape and a frame shadow style. See the illustration in the class documentation..PPThe frame shapes are:.TP\fCNoFrame\fR draws nothing. Naturally, you should not specify a shadow style if you use this..TP\fCBox\fR draws a rectangular box. The contents appear to be level with the surrounding screen, but the border itself may be raised or sunken..TP\fCPanel\fR draws a rectangular panel that can be raised or sunken..TP\fCStyledPanel\fR draws a rectangular panel with a look depending on the current GUI style. It can be raised or sunken..TP\fCPopupPanel\fR is used to draw a frame suitable for popup windows. Its look also depends on the current GUI style, usually the same as \fCStyledPanel.\fR.TP\fCWinPanel\fR draws a rectangular panel that can be raised or sunken, very 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\fCHLine\fR draws a horizontal line (vertically centered)..TP\fCVLine\fR draws a vertical line (horizontally centered)..PPThe shadow styles are:.TP\fCPlain\fR draws using the palette foreground color (without any 3D effect)..TP\fCRaised\fR draws a 3D raised line using the light and dark colors of the current color group..TP\fCSunken\fR draws a 3D sunken line using the light and dark colors of the current color group..PPIf a mid-line width greater than 0 is specified, an additional line is drawn for \fCRaised\fR or \fCSunken Box, HLine\fR and \fCVLine\fR frames. The mid color of the current color group is used for drawing middle lines..PPSee also: Illustration, frameStyle(), colorGroup() and QColorGroup..PPExamples:.(ltabdialog/tabdialog.cpp xform/xform.cpp cursor/cursor.cpp layout/layout.cpp popup/popup.cpp scrollview/scrollview.cpp customlayout/main.cpp.)l.SH "void QFrame::setLineWidth ( int w ) \fC[virtual]\fR"Sets the line width to \fIw.\fR.PPSee also: frameWidth(), lineWidth() and setMidLineWidth()..PPExamples:.(lxform/xform.cpp scrollview/scrollview.cpp.)l.SH "void QFrame::setMargin ( int w ) \fC[virtual]\fR"Sets the width of the margin to \fIw.\fR.PPSee also: margin() and setLineWidth()..PPExamples:.(ltabdialog/tabdialog.cpp scrollview/scrollview.cpp.)l.SH "void QFrame::setMidLineWidth ( int w ) \fC[virtual]\fR"Sets the width of the mid-line to \fIw.\fR.PPSee also: midLineWidth() and setLineWidth()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "QSizePolicy QFrame::sizePolicy () const \fC[virtual]\fR"If this is a line, it may stretch in the direction of the line, but it is fixed in the other direction. If this is a normal frame, use QWidget's default behavior..PPReimplemented from QWidget..SH "void QFrame::updateMask () \fC[virtual protected]\fR"Reimplementation of QWidget::updateMask(). Draws the mask of the frame when transparency is required..PPThis function calls the virtual functions drawFrameMask() and drawContentsMask(). These are the ones you may want to reimplement in subclasses..PPSee also: QWidget::setAutoMask(), drawFrameMask() and drawContentsMask()..PPReimplemented from QWidget..SH "SEE ALSO".BR http://www.troll.no/qt/qframe.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -