QFrame详解

qframe  其他基类的一个小窗口,有一个框架,像菜单可以在屏幕周围,像滚动条有一个凹陷,像label一样有一个浮动,


1.公有类型

enum Shadow { Plain, Raised, Sunken }//

enum Shape { NoFrame, Box, Panel, StyledPanel, ..., WinPanel }//

enum StyleMask { Shadow_Mask, Shape_Mask }//


2.属性

frameRect : QRect//控件矩形

frameWidth : const int//框架的宽度

frameShadow : Shadow//有无阴影

lineWidth : int//线宽度

frameShape : Shape//框架形状

midLineWidth : int//中间线的宽度


3.公有函数

QFrame(QWidget * parent = 0, Qt::WindowFlags f = 0)//构造函数,设置主窗口和框架类型

~QFrame()//析构函数

QRect frameRect() const//返回   框架的rect


Shadow frameShadow() const
Shape frameShape() const


int QFrame::frameStyle() const//返回框架风格,类似frameShadow()

int frameWidth() const
int lineWidth() const
int midLineWidth() const
void setFrameRect(const QRect &)
void setFrameShadow(Shadow)
void setFrameShape(Shape)
void setFrameStyle(int style)
void setLineWidth(int)
void setMidLineWidth(int)

3.重写公有函数

virtual QSize sizeHint() const//返回尺寸大小

4.保护函数

void initStyleOption(QStyleOptionFrame * option) const//初始化画一个框架

5.公有保护函数

virtual void changeEvent(QEvent * ev)//事件状态改变

virtual bool event(QEvent * e)//接收事件

virtual void paintEvent(QPaintEvent *)//重绘事件


















你可能感兴趣的:(QT)