📄 qframe.3qt
字号:
.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 and QPainter::setClipRect()..PPReimplemented in QLabel, QLCDNumber, QMenuBar and QPopupMenu..SH "void QFrame::drawFrame ( QPainter * p )\fC [virtual protected]\fR"Draws the frame using the painter \fIp\fR and 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() and palette..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()..SH "QRect QFrame::frameRect () const"Returns the frame rectangle. See the "frameRect" property for details..SH "Shadow QFrame::frameShadow () const"Returns the frame shadow value from the frame style. See the "frameShadow" property for details..SH "Shape QFrame::frameShape () const"Returns the frame shape value from the frame style. See the "frameShape" property for details..SH "int QFrame::frameStyle () const"Returns the frame style..PPThe default value is QFrame::NoFrame..PPSee also setFrameStyle(), frameShape and frameShadow..PPExample: scrollview/scrollview.cpp..SH "int QFrame::frameWidth () const"Returns the width of the frame that is drawn. See the "frameWidth" property for details..SH "int QFrame::lineWidth () const"Returns the line width. See the "lineWidth" property for details..SH "int QFrame::margin () const"Returns the width of the margin. See the "margin" property for details..SH "int QFrame::midLineWidth () const"Returns the width of the mid-line. See the "midLineWidth" property for details..SH "void QFrame::paintEvent ( QPaintEvent * event )\fC [virtual protected]\fR"Processes the paint event \fIevent\fR..PPPaints the frame and the contents..PPOpens the painter on the frame and calls drawFrame(), then drawContents()..PPExamples:.)l life/life.cpp and qfd/fontdisplayer.cpp..PPReimplemented from QWidget..PPReimplemented in QtTableView..SH "void QFrame::resizeEvent ( QResizeEvent * e )\fC [virtual protected]\fR"Processes the resize event \fIe\fR..PPAdjusts the frame rectangle for the resized widget. The frame rectangle is elastic, and 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..PPExample: life/life.cpp..PPReimplemented from QWidget..SH "void QFrame::setFrameRect ( const QRect & )\fC [virtual]\fR"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..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:.TPNoFrame draws nothing. Naturally, you should not specify a shadow style if you use this..TPBox draws a rectangular box. The contents appear to be level with the surrounding screen, but the border itself may be raised or sunken..TPPanel draws a rectangular panel that can be raised or sunken..TPStyledPanel draws a rectangular panel with a look that depends on the current GUI style. It can be raised or sunken..TPPopupPanel is used to draw a frame suitable for popup windows. Its look also depends on the current GUI style, usually the same as StyledPanel..TPToolBarPanel is used to draw a frame suitable for tool bars. The look depends upon the current GUI style..TPMenuBarPanel is used to draw a frame suitable for menu bars. The look depends upon the current GUI style..TPWinPanel 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..TPHLine draws a horizontal line (vertically centered)..TPVLine draws a vertical line (horizontally centered)..PPThe shadow styles are:.TPPlain draws using the palette foreground color (without any 3D effect)..TPRaised draws a 3D raised line using the light and dark colors of the current color group..TPSunken 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 Raised or Sunken Box, HLine, and VLine frames. The mid-color of the current color group is used for drawing middle lines..PPSee also Illustration, frameStyle(), colorGroup and QColorGroup..PPExamples:.)l cursor/cursor.cpp, layout/layout.cpp, listboxcombo/listboxcombo.cpp, rangecontrols/rangecontrols.cpp, scrollview/scrollview.cpp, tabdialog/tabdialog.cpp and tictac/tictac.cpp..SH "void QFrame::setLineWidth ( int )\fC [virtual]\fR"Sets the line width. See the "lineWidth" property for details..SH "void QFrame::setMargin ( int )\fC [virtual]\fR"Sets the width of the margin. See the "margin" property for details..SH "void QFrame::setMidLineWidth ( int )\fC [virtual]\fR"Sets the width of the mid-line. See the "midLineWidth" property for details..SS "Property Documentation".SH "QRect contentsRect"This property holds the rectangle inside the frame..PPGet this property's value with contentsRect()..PPSee also frameRect and drawContents()..SH "QRect frameRect"This property holds the frame rectangle..PPThe 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..PPIf this property is set to a null rectangle (for example \fCQRect(0,0,0,0)\fR), then the frame rectangle is equivalent to the widget rectangle..PPSee also contentsRect..PPSet 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..PPSet this property's value with setFrameShadow() and get this property's value with frameShadow()..PPSee also frameStyle() and frameShape..SH "Shape frameShape"This property holds the frame shape value from the frame style..PPSet this property's value with setFrameShape() and get this property's value with frameShape()..PPSee also frameStyle() and frameShadow..SH "int frameWidth"This property holds 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 NoFrame always has a frame width 0, whereas the style Panel has a frame width equivalent to the line width. The frame width also includes the margin..PPSee also lineWidth, midLineWidth, frameStyle() and margin..PPGet this property's value with frameWidth()..SH "int lineWidth"This property holds the line width..PPNote that the \fItotal\fR line width for HLine and VLine is given by frameWidth(), not lineWidth()..PPThe default value is 1..PPSee also midLineWidth and frameWidth..PPSet 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..PPThe margin is the distance between the innermost pixel of the frame and he outermost pixel of contentsRect(). It is included in frameWidth()..PPThe margin is filled according to backgroundMode()..PPThe default value is 0..PPSee also margin, lineWidth and frameWidth..PPSet 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..PPThe default value is 0..PPSee also lineWidth and frameWidth..PPSet this property's value with setMidLineWidth() and get this property's value with midLineWidth()..SH "SEE ALSO".BR http://doc.trolltech.com/qframe.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qframe.3qt) and the Qtversion (3.0.0).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -