QWidget类是所有用户界面对象的基类。详情请见……
#includeqwidget.h
继承QObject和QPaintDevice。
被QButton、QFrame、QDialog、QComboBox、QDataBrowser、QDataView、QDateTimeEdit、QDesktopWidget、QDial、QDockArea、QGLWidget、QHeader、QMainWindow、QNPWidget、QScrollBar、QSizeGrip、QSlider、QSpinBox、QStatusBar、QTabBar、QTabWidget、QWorkspace和QXtWidget继承。
所有成员函数的列表。
公有成员
QWidget(QWidget*parent=0,constchar*name=0,WFlagsf=0)
~QWidget()
WIdwinId()const
QStylestyle()const
voidsetStyle(QStyle*style)
QStyle*setStyle(constQStringstyle)
boolisTopLevel()const
boolisDialog()const
boolisPopup()const
boolisDesktop()const
boolisModal()const
boolisEnabled()const
boolisEnabledTo(QWidget*ancestor)const
boolisEnabledToTLW()const(obsolete)
QRectframeGeometry()const
constQRectgeometry()const
intx()const
inty()const
QPointpos()const
QSizeframeSize()const
QSizesize()const
intwidth()const
intheight()const
QRectrect()const
QRectchildrenRect()const
QRegionchildrenRegion()const
QSizeminimumSize()const
QSizemaximumSize()const
intminimumWidth()const
intminimumHeight()const
intmaximumWidth()const
intmaximumHeight()const
voidsetMinimumSize(constQSize)
virtualvoidsetMinimumSize(intminw,intminh)
voidsetMaximumSize(constQSize)
virtualvoidsetMaximumSize(intmaxw,intmaxh)
voidsetMinimumWidth(intminw)
voidsetMinimumHeight(intminh)
voidsetMaximumWidth(intmaxw)
voidsetMaximumHeight(intmaxh)
QSizesizeIncrement()const
voidsetSizeIncrement(constQSize)
virtualvoidsetSizeIncrement(intw,inth)
QSizebaseSize()const
voidsetBaseSize(constQSize)
voidsetBaseSize(intbasew,intbaseh)
voidsetFixedSize(constQSizes)
voidsetFixedSize(intw,inth)
voidsetFixedWidth(intw)
voidsetFixedHeight(inth)
QPointmapToGlobal(constQPointpos)const
QPointmapFromGlobal(constQPointpos)const
QPointmapToParent(constQPointpos)const
QPointmapFromParent(constQPointpos)const
QPointmapTo(QWidget*parent,constQPointpos)const
QPointmapFrom(QWidget*parent,constQPointpos)const
QWidget*topLevelWidget()const
BackgroundModebackgroundMode()const
virtualvoidsetBackgroundMode(BackgroundMode)
voidsetBackgroundMode(BackgroundModem,BackgroundModevisual)
constQColorforegroundColor()const
constQColoreraseColor()const
virtualvoidsetEraseColor(constQColorcolor)
constQPixmap*erasePixmap()const
virtualvoidsetErasePixmap(constQPixmappixmap)
constQColorGroupcolorGroup()const
constQPalettepalette()const
boolownPalette()const
virtualvoidsetPalette(constQPalette)
voidunsetPalette()
constQColorpaletteForegroundColor()const
voidsetPaletteForegroundColor(constQColor)
constQColorpaletteBackgroundColor()const
virtualvoidsetPaletteBackgroundColor(constQColor)
constQPixmap*paletteBackgroundPixmap()const
virtualvoidsetPaletteBackgroundPixmap(constQPixmap)
constQBrushbackgroundBrush()const
QFontfont()const
boolownFont()const
virtualvoidsetFont(constQFont)
voidunsetFont()
QFontMetricsfontMetrics()const
QFontInfofontInfo()const
constQCursorcursor()const
boolownCursor()const
virtualvoidsetCursor(constQCursor)
virtualvoidunsetCursor()
QStringcaption()const
constQPixmap*icon()const
QStringiconText()const
boolhasMouseTracking()const
boolhasMouse()const
virtualvoidsetMask(constQBitmapbitmap)
virtualvoidsetMask(constQRegionregion)
voidclearMask()
constQColorbackgroundColor()const(obsolete)
virtualvoidsetBackgroundColor(constQColorc)(obsolete)
constQPixmap*backgroundPixmap()const(obsolete)
virtualvoidsetBackgroundPixmap(constQPixmappm)(obsolete)
enumFocusPolicy{NoFocus=0,TabFocus=0x1,ClickFocus=0x2,StrongFocus=0x3,WheelFocus=0x7}
boolisActiveWindow()const
virtualvoidsetActiveWindow()
boolisFocusEnabled()const
FocusPolicyfocusPolicy()const
virtualvoidsetFocusPolicy(FocusPolicy)
boolhasFocus()const
virtualvoidsetFocusProxy(QWidget*w)
QWidget*focusProxy()const
voidgrabMouse()
voidgrabMouse(constQCursorcursor)
voidreleaseMouse()
voidgrabKeyboard()
voidreleaseKeyboard()
boolisUpdatesEnabled()const
virtualboolclose(boolalsoDelete)
boolisVisible()const
boolisVisibleTo(QWidget*ancestor)const
boolisVisibleToTLW()const(obsolete)
QRectvisibleRect()const
boolisHidden()const
boolisMinimized()const
boolisMaximized()const
virtualQSizesizeHint()const
virtualQSizeminimumSizeHint()const
virtualQSizePolicysizePolicy()const
virtualvoidsetSizePolicy(QSizePolicy)
virtualintheightForWidth(intw)const
virtualvoidadjustSize()
QLayout*layout()const
voidupdateGeometry()
virtualvoidreparent(QWidget*parent,WFlagsf,constQPointp,boolshowIt=FALSE)
voidreparent(QWidget*parent,constQPointp,boolshowIt=FALSE)
voidrecreate(QWidget*parent,WFlagsf,constQPointp,boolshowIt=FALSE)(obsolete)
voiderase()
voiderase(intx,inty,intw,inth)
voiderase(constQRectr)
voiderase(constQRegionreg)
voidscroll(intdx,intdy)
voidscroll(intdx,intdy,constQRectr)
voiddrawText(intx,inty,constQStringstr)
voiddrawText(constQPointpos,constQStringstr)
QWidget*focusWidget()const
QRectmicroFocusHint()const
boolacceptDrops()const
virtualvoidsetAcceptDrops(boolon)
virtualvoidsetAutoMask(bool)
boolautoMask()const
enumBackgroundOrigin{WidgetOrigin,ParentOrigin,WindowOrigin}
virtualvoidsetBackgroundOrigin(BackgroundOrigin)
BackgroundOriginbackgroundOrigin()const
virtualboolcustomWhatsThis()const
QWidget*parentWidget(boolsameWindow=FALSE)const
WFlagstestWFlags(WFlagsf)const
QWidget*childAt(intx,inty,boolincludeThis=FALSE)const
QWidget*childAt(constQPointp,boolincludeThis=FALSE)const
voidsetPalette(constQPalettep,bool)(obsolete)
voidsetFont(constQFontf,bool)(obsolete)
公有槽
virtualvoidsetEnabled(bool)
voidsetDisabled(booldisable)
virtualvoidsetCaption(constQString)
virtualvoidsetIcon(constQPixmap)
virtualvoidsetIconText(constQString)
virtualvoidsetMouseTracking(boolenable)
virtualvoidsetFocus()
voidclearFocus()
virtualvoidsetUpdatesEnabled(boolenable)
voidupdate()
voidupdate(intx,inty,intw,inth)
voidupdate(constQRectr)
voidrepaint()
voidrepaint(boolerase)
voidrepaint(intx,inty,intw,inth,boolerase=TRUE)
voidrepaint(constQRectr,boolerase=TRUE)
voidrepaint(constQRegionreg,boolerase=TRUE)
virtualvoidshow()
virtualvoidhide()
voidiconify()(obsolete)
virtualvoidshowMinimized()
virtualvoidshowMaximized()
voidshowFullScreen()
virtualvoidshowNormal()
virtualvoidpolish()
voidconstPolish()const
boolclose()
voidraise()
voidlower()
voidstackUnder(QWidget*w)
virtualvoidmove(intx,inty)
voidmove(constQPoint)
virtualvoidresize(intw,inth)
voidresize(constQSize)
virtualvoidsetGeometry(intx,inty,intw,inth)
virtualvoidsetGeometry(constQRect)
静态公有成员
voidsetTabOrder(QWidget*first,QWidget*second)
QWidget*mouseGrabber()
QWidget*keyboardGrabber()
QWidget*find(WIdid)
属性
boolacceptDrops-窗口部件中放下事件是否有效
boolautoMask-窗口部件中自动面具特征是否有效
QBrushbackgroundBrush-窗口部件的背景画刷(只读)
BackgroundModebackgroundMode-绘制窗口部件背景所使用的颜色模式
BackgroundOriginbackgroundOrigin-窗口部件的背景的原点
QSizebaseSize-窗口部件的基础大小
QStringcaption-窗口标题
QRectchildrenRect-窗口部件的子对象的边界矩形(只读)
QRegionchildrenRegion-窗口部件的子对象所占用的组合区域(只读)
QColorGroupcolorGroup-窗口部件调色板的当前颜色组(只读)
QCursorcursor-窗口部件的光标外形
boolcustomWhatsThis-窗口部件是否手动处理“这是什么”的帮助(只读)
boolenabled-窗口部件是否有效
boolfocus-窗口部件(或者它的焦点代理)是否得到键盘输入焦点(只读)
boolfocusEnabled-窗口部件是否接收键盘焦点(只读)
FocusPolicyfocusPolicy-窗口部件接收键盘焦点的策略
QFontfont-窗口部件当前的字体集
QRectframeGeometry-相对于它的父对象包含任何窗口框架的窗口部件的几何形状(只读)
QSizeframeSize-包含任何窗口框架的窗口部件的大小(只读)
QRectgeometry-相对于它的父对象不包括窗口框架的窗口部件的几何形状
intheight-不包括窗口框架的窗口部件的高度(只读)
boolhidden-窗口部件是否明确地隐藏(只读)
QPixmapicon-窗口部件图标像素映射
QStringiconText-窗口部件图标文本
boolisActiveWindow-窗口部件或者它的一个子对象是否是活动窗口(只读)
boolisDesktop-窗口部件是否是桌面窗口部件,比如,代表桌面(只读)
boolisDialog-窗口部件是否是对话框窗口部件(只读)
boolisModal-窗口部件是否是模式窗口部件(只读)
boolisPopup-窗口部件是否是弹出窗口部件(只读)
boolisTopLevel-窗口部件是否是顶级窗口部件(只读)
intmaximumHeight-窗口部件的最大高度
QSizemaximumSize-窗口部件的最大大小
intmaximumWidth-窗口部件的最大宽度
QRectmicroFocusHint-窗口部件的当前设置的微焦点提示(只读)
boolminimized-窗口部件是否是最小化的(变为图标了)(只读)
intminimumHeight-窗口部件的最小高度
QSizeminimumSize-窗口部件的最小大小
QSizeminimumSizeHint-建议的窗口部件最小大小(只读)
intminimumWidth-窗口部件的最小宽度
boolmouseTracking-窗口部件跟踪鼠标是否生效
boolownCursor-窗口部件是否使用它自己的光标(只读)
boolownFont-窗口部件是否使用它自己的字体(只读)
boolownPalette-窗口部件是否使用它自己的调色板(只读)
QPalettepalette-窗口部件的调色板
QColorpaletteBackgroundColor-窗口部件的背景色
QPixmappaletteBackgroundPixmap-窗口部件的背景像素映射
QColorpaletteForegroundColor-窗口部件的前景色
QPointpos-窗口部件在它的父窗口部件中的位置
QRectrect-不包含任何窗口框架的窗口部件的内部几何形状(只读)
QSizesize-不包含任何窗口框架的窗口部件的大小
QSizesizeHint-建议的窗口部件大小(只读)
QSizesizeIncrement-窗口部件的大小增量
QSizePolicysizePolicy-窗口部件的默认布局行为
boolunderMouse-窗口部件是否在鼠标光标下(只读)
boolupdatesEnabled-更新是否生效
boolvisible-窗口部件是否可视(只读)
QRectvisibleRect-窗口部件的当前可视矩形(只读)
intwidth-不包含任何窗口框架的窗口部件宽度(只读)
intx-相对于它的父对象包含任何窗口框架的窗口部件的x坐标(只读)
inty-相对于它的父对象包含任何窗口框架的窗口部件的y坐标(只读)
保护成员
virtualboolevent(QEvent*e)
virtualvoidmousePressEvent(QMouseEvent*e)
virtualvoidmouseReleaseEvent(QMouseEvent*e)
virtualvoidmouseDoubleClickEvent(QMouseEvent*e)
virtualvoidmouseMoveEvent(QMouseEvent*e)
virtualvoidwheelEvent(QWheelEvent*e)
virtualvoidkeyPressEvent(QKeyEvent*e)
virtualvoidkeyReleaseEvent(QKeyEvent*e)
virtualvoidfocusInEvent(QFocusEvent*)
virtualvoidfocusOutEvent(QFocusEvent*)
virtualvoidenterEvent(QEvent*)
virtualvoidleaveEvent(QEvent*)
virtualvoidpaintEvent(QPaintEvent*)
virtualvoidmoveEvent(QMoveEvent*)
virtualvoidresizeEvent(QResizeEvent*)
virtualvoidcloseEvent(QCloseEvent*e)
virtualvoidcontextMenuEvent(QContextMenuEvent*e)
virtualvoidimStartEvent(QIMEvent*e)
virtualvoidimComposeEvent(QIMEvent*e)
virtualvoidimEndEvent(QIMEvent*e)
virtualvoidtabletEvent(QTabletEvent*e)
virtualvoiddragEnterEvent(QDragEnterEvent*)
virtualvoiddragMoveEvent(QDragMoveEvent*)
virtualvoiddragLeaveEvent(QDragLeaveEvent*)
virtualvoiddropEvent(QDropEvent*)
virtualvoidshowEvent(QShowEvent*)
virtualvoidhideEvent(QHideEvent*)
virtualboolmacEvent(MSG*)
virtualboolwinEvent(MSG*)
virtualboolx11Event(XEvent*)
virtualboolqwsEvent(QWSEvent*)
virtualvoidupdateMask()
virtualvoidstyleChange(QStyleoldStyle)
virtualvoidenabledChange(boololdEnabled)
virtualvoidpaletteChange(constQPaletteoldPalette)
virtualvoidfontChange(constQFontoldFont)
virtualvoidwindowActivationChange(boololdActive)
virtualintmetric(intm)const
voidresetInputContext()
virtualvoidcreate(WIdwindow=0,boolinitializeWindow=TRUE,booldestroyOldWindow=TRUE)
virtualvoiddestroy(booldestroyWindow=TRUE,booldestroySubWindows=TRUE)
WFlagsgetWFlags()const
virtualvoidsetWFlags(WFlagsf)
voidclearWFlags(WFlagsf)
virtualboolfocusNextPrevChild(boolnext)
QFocusData*focusData()
virtualvoidsetKeyCompression(bool