Qt 4.8
|
The QDecorationDefault class is a base class providing default window decorations. More...
#include <qdecorationdefault_qws.h>
Public Functions | |
virtual bool | paint (QPainter *painter, const QWidget *widget, int decorationRegion=All, DecorationState state=Normal) |
Paints the border and title decoration for the top-level widget using the painter provided and the decoration state. More... | |
QDecorationDefault () | |
Default constructor. More... | |
virtual QRegion | region (const QWidget *widget, const QRect &rect, int decorationRegion=All) |
Returns the region specified by decorationRegion for the top-level widget. More... | |
virtual | ~QDecorationDefault () |
The constructor deletes the static pixmaps. More... | |
Public Functions inherited from QDecoration | |
virtual void | buildSysMenu (QWidget *widget, QMenu *menu) |
Builds the system menu for the given top level widget, adding Restore, Move, Size, Minimize, Maximize and Close actions to the given menu. More... | |
void | menuTriggered (QWidget *widget, QAction *action) |
This function is called whenever an action in a top level widget's menu is triggered, and simply calls the regionClicked() function passing the widget and action parameters as arguments. More... | |
QDecoration () | |
Constructs a decoration object. More... | |
QRegion | region (const QWidget *w, int decorationRegion=All) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
virtual int | regionAt (const QWidget *w, const QPoint &point) |
Returns the type of the first region of the specified top level widget containing the given point. More... | |
virtual void | regionClicked (QWidget *widget, int region) |
Handles the event that the specified region in the given top level widget is activated by a single click (the region parameter is described using the DecorationRegion enum). More... | |
virtual void | regionDoubleClicked (QWidget *widget, int region) |
Handles the event that the specified region in the given top level widget is activated by a double click (the region parameter is described using the DecorationRegion enum). More... | |
virtual | ~QDecoration () |
Destroys this decoration object. More... | |
Protected Functions | |
virtual void | paintButton (QPainter *painter, const QWidget *widget, int buttonRegion, DecorationState state, const QPalette &pal) |
Paints a region of the top-level widget. More... | |
virtual QPixmap | pixmapFor (const QWidget *widget, int decorationRegion, int &xoff, int &yoff) |
Returns a pointer to the QPixmap for the widget specified by widget and decorationRegion. More... | |
virtual int | titleBarHeight (const QWidget *widget) |
Returns the title bar height in pixels for the given widget. More... | |
QString | windowTitleFor (const QWidget *widget) const |
virtual const char ** | xpmForRegion (int region) |
Returns a pointer to the X pixmap for the icon specified by region. More... | |
Protected Variables | |
int | close_width |
int | help_width |
int | maximize_width |
int | menu_width |
int | minimize_width |
int | normalize_width |
Static Private Attributes | |
static QPixmap * | staticClosePixmap = 0 |
static QPixmap * | staticHelpPixmap = 0 |
static QPixmap * | staticMaximizePixmap = 0 |
static QPixmap * | staticMenuPixmap = 0 |
static QPixmap * | staticMinimizePixmap = 0 |
static QPixmap * | staticNormalizePixmap = 0 |
Additional Inherited Members | |
Public Types inherited from QDecoration | |
enum | DecorationRegion { None = 0x0000000000, All = 0x7fffffff, TopLeft = 0x0000000001, Top = 0x0000000002, TopRight = 0x0000000004, Left = 0x0000000008, Right = 0x0000000010, BottomLeft = 0x0000000020, Bottom = 0x0000000040, BottomRight = 0x0000000080, Borders = 0x00000000ff, Menu = 0x0000000100, Title = 0x0000000200, Help = 0x0000000400, Minimize = 0x0000000800, Maximize = 0x0000001000, Normalize = 0x0000002000, Close = 0x0000004000, Move = 0x0000008000, Resize = 0x0000010000 } |
This enum describes the various regions of the window decoration. More... | |
enum | DecorationState { Normal = 0x04, Disabled = 0x08, Hover = 0x01, Pressed = 0x02 } |
This enum describes the various states of a decoration region. More... | |
Static Public Functions inherited from QDecoration | |
static void | startMove (QWidget *widget) |
Starts to move the given top level widget by making its Title region active and grabbing the mouse input. More... | |
static void | startResize (QWidget *widget) |
Starts to resize the given top level widget by making its BottomRight region active and grabbing the mouse input. More... | |
The QDecorationDefault class is a base class providing default window decorations.
See the documentation for class QDecoration for a detailed description. This subclass of QDecoration provides standard icons for the decoration regions.
Note that this class is non-portable and only available in Qt for Embedded Linux.
Definition at line 59 of file qdecorationdefault_qws.h.
QDecorationDefault::QDecorationDefault | ( | ) |
Default constructor.
Definition at line 229 of file qdecorationdefault_qws.cpp.
|
virtual |
The constructor deletes the static pixmaps.
Definition at line 243 of file qdecorationdefault_qws.cpp.
|
virtual |
Paints the border and title decoration for the top-level widget using the painter provided and the decoration state.
The value of decorationRegion is a combination of the bitmask values of enum DecorationRegion.
Note that Qt for Embedded Linux expects this function to return true if any of the widget's decorations are repainted; otherwise it returns false.
Implements QDecoration.
Reimplemented in QDecorationStyled, and QDecorationWindows.
Definition at line 644 of file qdecorationdefault_qws.cpp.
Referenced by QDecorationWindows::paint().
|
protectedvirtual |
Paints a region of the top-level widget.
The region is painted in the specified decoration state using the painter and palette provided. The region to be painted is specified by buttonRegion, which is a combination of the bitmask values of DecorationRegion. If the value of buttonRegion is one of Help, Menu, Close, Minimize, Maximize, and Normalize, the button pixmap for that region is painted.
Reimplemented in QDecorationWindows.
Definition at line 765 of file qdecorationdefault_qws.cpp.
Referenced by paint().
|
protectedvirtual |
Returns a pointer to the QPixmap for the widget specified by widget and decorationRegion.
The returned QPixmap is constructed from the default X pixmap obtained from xpmForRegion().
xoff and yoff specify the offset for the pixmap.
The value of decorationRegion must be one of a subset of the values of enum DecorationRegion. The supported values are Help, Menu, Close, Minimize, Maximize, and Normalize. Other values of decorationRegion return 0.
Definition at line 312 of file qdecorationdefault_qws.cpp.
Referenced by QDecorationWindows::paintButton(), and paintButton().
|
virtual |
Returns the region specified by decorationRegion for the top-level widget.
rect specifies the rectangle the decoration wraps. The value of decorationRegion is a combination of the bitmask values of enum DecorationRegion.
Implements QDecoration.
Reimplemented in QDecorationStyled, and QDecorationWindows.
Definition at line 409 of file qdecorationdefault_qws.cpp.
Referenced by QDecorationStyled::region(), and QDecorationWindows::region().
|
protectedvirtual |
Returns the title bar height in pixels for the given widget.
It is the greater of 20, or the sum of the application font's line spacing value plus a border width fudge factor.
Reimplemented in QDecorationStyled.
Definition at line 398 of file qdecorationdefault_qws.cpp.
Referenced by region().
Definition at line 799 of file qdecorationdefault_qws.cpp.
Referenced by QDecorationStyled::paint(), QDecorationWindows::paint(), paint(), QDecorationStyled::region(), and QDecorationStyled::titleBarHeight().
|
protectedvirtual |
Returns a pointer to the X pixmap for the icon specified by region.
An X pixmap is an ASCII-text-based image. The value of region must be one of a subset of the values of enum DecorationRegion. The supported values are Help, Menu, Close, Minimize, Maximize, and Normalize. Other values of region cause zero to be returned.
Reimplemented in QDecorationWindows.
Definition at line 271 of file qdecorationdefault_qws.cpp.
Referenced by pixmapFor(), and QDecorationWindows::xpmForRegion().
|
protected |
Definition at line 81 of file qdecorationdefault_qws.h.
Referenced by QDecorationDefault(), QDecorationWindows::QDecorationWindows(), QDecorationWindows::region(), and region().
|
protected |
Definition at line 80 of file qdecorationdefault_qws.h.
Referenced by QDecorationDefault(), QDecorationWindows::QDecorationWindows(), QDecorationWindows::region(), and region().
|
protected |
Definition at line 83 of file qdecorationdefault_qws.h.
Referenced by QDecorationDefault(), QDecorationWindows::QDecorationWindows(), QDecorationWindows::region(), and region().
|
protected |
Definition at line 79 of file qdecorationdefault_qws.h.
Referenced by QDecorationDefault(), QDecorationWindows::QDecorationWindows(), QDecorationWindows::region(), and region().
|
protected |
Definition at line 82 of file qdecorationdefault_qws.h.
Referenced by QDecorationDefault(), QDecorationWindows::QDecorationWindows(), QDecorationWindows::region(), and region().
|
protected |
Definition at line 84 of file qdecorationdefault_qws.h.
Referenced by QDecorationDefault().
|
staticprivate |
Definition at line 89 of file qdecorationdefault_qws.h.
Referenced by pixmapFor(), and ~QDecorationDefault().
|
staticprivate |
Definition at line 87 of file qdecorationdefault_qws.h.
Referenced by pixmapFor().
|
staticprivate |
Definition at line 91 of file qdecorationdefault_qws.h.
Referenced by pixmapFor(), and ~QDecorationDefault().
|
staticprivate |
Definition at line 88 of file qdecorationdefault_qws.h.
Referenced by pixmapFor(), and ~QDecorationDefault().
|
staticprivate |
Definition at line 90 of file qdecorationdefault_qws.h.
Referenced by pixmapFor(), and ~QDecorationDefault().
|
staticprivate |
Definition at line 92 of file qdecorationdefault_qws.h.
Referenced by pixmapFor(), and ~QDecorationDefault().