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

📄 qframe.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QFrame 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech 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.PP\fC#include <qframe.h>\fR.PPInherits QWidget..PPInherited by QGroupBox, QScrollView, QDockWindow, QGrid, QHBox, QLabel, QLCDNumber, QLineEdit, QMenuBar, QPopupMenu, QProgressBar, QSplitter, QtTableView and QWidgetStack..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQFrame\fR ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )".br.ti -1c.BI "int \fBframeStyle\fR () const".br.ti -1c.BI "virtual void \fBsetFrameStyle\fR ( int style )".br.ti -1c.BI "int \fBframeWidth\fR () const".br.ti -1c.BI "QRect \fBcontentsRect\fR () const".br.ti -1c.BI "enum \fBShape\fR { NoFrame = 0, Box = 0x0001, Panel = 0x0002, WinPanel = 0x0003, HLine = 0x0004, VLine = 0x0005, StyledPanel = 0x0006, PopupPanel = 0x0007, MenuBarPanel = 0x0008, ToolBarPanel = 0x0009, MShape = 0x000f }".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 "Properties".in +1c.ti -1c.BI "QRect \fBcontentsRect\fR - the rectangle inside the frame  \fI(read " "only" ")\fR".br.ti -1c.BI "QRect \fBframeRect\fR - the frame rectangle".br.ti -1c.BI "Shadow \fBframeShadow\fR - the frame shadow value from the frame style".br.ti -1c.BI "Shape \fBframeShape\fR - the frame shape value from the frame style".br.ti -1c.BI "int \fBframeWidth\fR - the width of the frame that is drawn  \fI(read " "only" ")\fR".br.ti -1c.BI "int \fBlineWidth\fR - the line width".br.ti -1c.BI "int \fBmargin\fR - the width of the margin".br.ti -1c.BI "int \fBmidLineWidth\fR - the width of the mid-line".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBpaintEvent\fR ( QPaintEvent * event )".br.ti -1c.BI "virtual void \fBresizeEvent\fR ( QResizeEvent * e )".br.ti -1c.BI "virtual void \fBdrawFrame\fR ( QPainter * p )".br.ti -1c.BI "virtual void \fBdrawContents\fR ( QPainter * )".br.ti -1c.BI "virtual void \fBframeChanged\fR ()".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 subclasses. There are also two other less useful functions: drawFrame() and frameChanged()..PPQPopupMenu uses this to "raise" the menu above the surrounding screen. QProgressBar has a "sunken" look. QLabel has a flat look. The frames of widgets such as these can be changed..PP.nf.br    QLabel label(...);.br    label.setFrameStyle( QFrame::Panel | QFrame::Raised );.br    label.setLineWidth( 2 );.br.br    QProgressBar pbar(...);.br    label.setFrameStyle( QFrame::NoFrame );.br.fi.PPThe 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..PPA frame widget has four attributes: frameStyle(), lineWidth(), midLineWidth(), and margin()..PPThe 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..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, 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..PPThe margin is the gap between the frame and the contents of the frame..PPThis table shows the most useful combinations of styles and widths (and some rather useless ones):.PP.ce 1.B "[Image Omitted]".PPSee also Abstract Widget Classes..SS "Member Type Documentation".SH "QFrame::Shadow"This enum type defines the 3D effect used for QFrame's frame. The currently defined effects are:.TP\fCQFrame::Plain\fR - the frame and contents appear level with the surroundings.TP\fCQFrame::Raised\fR - the frame and contents appear raised.TP\fCQFrame::Sunken\fR - the frame and contents appear sunken.TP\fCQFrame::MShadow\fR - internal; mask for the shadow.PPShadow interacts with QFrame::Shape, the lineWidth() and the midLineWidth(). The picture of the frames in the class documentation may illustrate this better than words..PPSee also QFrame::Shape, lineWidth and midLineWidth..SH "QFrame::Shape"This enum type defines the shapes of a QFrame's frame. The currently defined shapes are: .IP.TPNoFrame - QFrame draws nothing.TPBox - QFrame draws a box around its contents.TPPanel - QFrame draws a panel such that the contents appear raised or sunken.TPWinPanel - like Panel, but QFrame draws the 3D effects the way Microsoft Windows 95 (etc.) does.TPToolBarPanel - QFrame calls QStyle::drawToolBarPanel().TPMenuBarPanel - QFrame calls QStyle::drawMenuBarPanel().TPHLine - QFrame draws a horizontal line that frames nothing (useful as separator).TPVLine - QFrame draws a vertical line that frames nothing (useful as separator).TPStyledPanel - QFrame calls QStyle::drawPanel().TPPopupPanel - QFrame calls QStyle::drawPopupPanel().IP.PPWhen it does not call QStyle, Shape interacts with QFrame::Shadow, the lineWidth() and the midLineWidth() to create the total result. The picture of the frames in the class documentation may illustrate this better than words..PPSee also QFrame::Shadow, QFrame::style() and QStyle::drawPrimitive()..SH MEMBER FUNCTION DOCUMENTATION.SH "QFrame::QFrame ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )"Constructs a frame widget with frame style NoFrame and a 1-pixel frame width..PPThe \fIparent\fR, \fIname\fR and \fIf\fR arguments are passed to the QWidget constructor..SH "QRect QFrame::contentsRect () const"Returns the rectangle inside the frame. See the "contentsRect" property for details..SH "void QFrame::drawContents ( QPainter * )\fC [virtual protected]\fR"Virtual function that draws the contents of the frame.

⌨️ 快捷键说明

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