The QWidget class is the base class of all user interface objects. (details) (complete member list)
#include <qwidget.h>
Inherits QObject and QPaintDevice.
Inherited by QButton, QComboBox, QFrame, QLineEdit, QMenuBar, QScrollBar and QView.
Lots of verbiage here...
Constructs a new QWidget inside parent, named name, optionally with widget flags f.
The widget flags are strictly internal and likely to change before 1.0. You are strongly advised to use 0.
If parent is 0, the new widget will be a top level window.
The widget name is not used in this version of Qt, it is reserved for future use.
Destroys the widget. All children of this widget are deleted first. The application exits if this widget is (was) the main widget.
This function is virtual and does nothing by default.
See also: event()
Returns the widget cursor shape.
See also: setCursor().
This signal is emitted immediately before the widget is destroyed.
All the widget's children will be destroyed before the signal is emitted.
Writes s to position p. The y position is the base line, not the top or bottom of the text. The text is drawn in the current font and so on.
See also: setFont(), FontMetrics(), QPainter::drawText.
Writes str to position x,y. The y position is the base line, not the top or bottom of the text. The text is drawn in the current font and so on.
See also: setFont(), FontMetrics(), QPainter::drawText.
This function is virtual and does nothing by default.
See also: event()
This function is virtual and does nothing by default.
See also: event()
Returns the font currently set for the widget.
QFontInfo will tell you what font is actually being used.
See also: setFont(), fontMetrics() and fontInfo().
Returns the font information of the font currently in use by this widget.
See also: fontMetrics(), font() and setFont().
Returns the font metrics of the font currently in use by this widget.
See also: fontInfo(), font() and setFont().
Returns the geometry of the widget, relative to its parent and including any frame the window manager decides to decorate the window with.
See also: geometry().
Returns the geometry of the widget, relative to its parent widget and excluding frames and other decorations.
See also: frameGeometry(), QRect, size(), x(), y(), pos(), and rect().
Grabs the keyboard input focus.
This widget will receive all keyboard events, no matter where the mouse cursor is.
See also: releaseKeyboard(), grabMouse(), releaseMouse().
Grabs the mouse input.
The widget will continue to get mouse events until releaseMouse() is called.
Warning: This might lock your terminal.
It is almost never necessary to grab the mouse when using Qt since Qt grabs and releases it sensibly. In particular, Qt grabs the mouse when a button is pressed and keeps it until the last button is released.
See also: releaseMouse().
Grabs the mouse intput and change the cursor shape.
The cursor will assume shape cursor (for as long as the mouse focus is grabbed) and the widget will continue getting mouse events until releaseMouse() is called().
See also: releaseMouse(), setCursor().
Returns TRUE if the widget (not one of its children) has the keyboard focus.
Returns the height of the widget, excluding any window frames.
Returns the window system identifier of the widget. Portable in principle, but if you use it you are probably about to do something non-portable. Be careful.
See also: find().
Returns TRUE if the widget is disabled, or FALSE if it is enabled.
See also: enable() and disable().
Returns TRUE if the widget is visible, or FALSE if the widget is invisible.
Calling show() makes the widget visible. Calling hide() makes the widget invisible.
A widget is considered visible even if it is obscured by other windows on the screen.
This function is virtual and does nothing by default.
See also: event()
This function is virtual and does nothing by default.
See also: event()
Translates the global screen coordinate pos to widget coordinates.
See also: mapToGlobal().
Translates the parent widget coordinate pos to widget coordinates.
Same as mapFromGlobal() if the widget has no parent.
See also: mapToParent().
Translates the widget coordinate pos to global screen coordinates.
See also: mapFromGlobal().
Translates the widget coordinate pos to a coordinate in the parent widget.
Same as mapToGlobal() if the widget has no parent.
See also: mapFromParent().
This function is virtual and translates to a single click by default.
See also: event()
This function is virtual and does nothing by default.
See also: event()
This function is virtual and does nothing by default.
See also: event()
This function is virtual and does nothing by default.
See also: event()
Moves the widget to position p, which is relative to the widget's arent. If necessary, the window manager is told about the change. A move event is sent at once.
See also: resize(), setGeometry(), moveEvent().
This function is virtual and does nothing by default.
See also: event()
This function is virtual and does nothing by default.
See also: event()
Returns a pointer to the parent of this widget, or a null pointer if it does not have any parent widget.
Returns the postion of the widget in its parent widget, excluding frames and other decorations.
See also: frameGeometry(), x() and y().
This function is provided in case a widget should feel really bad, regret that it was even born.
It gives the widget a fresh start, new parent, new widget flags (f but as usual, use 0) at a new position in its new parent (p).
If showIt is TRUE, show() is called once the widget has been recreated.
Returns the the internal geometry of the widget, excluding any window frames. rect() equals QRect(0,0,width(),height()).
See also: size().
Releases the keyboard focus. The keyboard events will follow their natural inclination.
See also: grabKeyboard(), grabMouse(), releaseMouse().
Releases the mouse from a grab.
See also: grabMouse().
Repaints the widget directly.
Doing a repaint() is faster than doing an update(), but since repaint() does not make a server trip and there is some time skew between the server and client, your client may get confused.
Resizes the widget to size p. If necessary, the window manager is told about the change. A resize event is sent at once.
See also: move(), setGeometry(), resizeEvent().
This function is virtual and does nothing by default.
See also: event()
Enables or disables the keyboard input focus events for the widget.
Focus events are initially disabled.
Sets the background color of this widget.
The background color is independent of the widget color group.
Notice that the background color will be overwritten when setting
a new palette.
See also: backgroundColor() and setPalette().
Sets the background pixmap of the widget to pm.
The background pixmap is tiled.
Sets the widget cursor shape.
The mouse cursor will assume this shape when it's over this widget. The available shapes are listed in the QCursor documentation.
An editor widget would for example use an I-beam cursor:
setCursor( ibeamCursor );
See also: cursor().
Changes the widget geometry to r, relative to its parent widget. If necessary, the window manager is informed. First a resize and then a move event is sent to the widget itself.
Changes the widget geometry to x pixels by y, positioned at w,h in its parent widget. If necessary, the window manager is informed. First a resize and then a move event is sent to the widget itself.
This function is virtual, and all other overloaded setGeometry() implementations call it.
Enables or disables mouse tracking and returns the previous setting.
If mouse tracking is enabled, the widget will always receive mouse move events, even when no mouse button is pressed down.
If mouse tracking is disabled (default), the widget will only receive mouse move events when a mouse button is pressed down.
See also: mouseMoveEvent().
Sets the size increment of the widget. When the user resizes the widget, the size will move in steps of w horizontally and h vertically. Both default to 1.
See also: setMaximumSize() and setSizeIncrement().
Returns the size of the widget, excluding any window frames.
See also: geometry(), width() and height().
Returns non-zero if any of the widget flags in n are set. The widget flags are listed in qwindefs.h, and are strictly for internal use.
This function is virtual and does nothing by default.
See also: event()
Updates a rectangle (x, y, w, h) inside the widget.
Calling update() will generate a paint event from the X server.
Returns the width of the widget, excluding any window frames.
See also: size() and height().
Returns the x coordinate of the widget, relative to its parent widget and excluding frames and other decorations.
See also: geometry(), pos() and y().
Returns the y coordinate of the widget, relative to its parent widget and excluding frames and other decorations.
See also: geometry(), pos() and x().
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: