|  | Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions |

# QDecoration Class Reference

The QDecoration class allows the appearance of the Qt/Embedded Window Manager to be customized. More...

    #include <QDecoration>

Part of the QtGui module.

- List of all members, including inherited members

### Public Types

- enum DecorationRegion { All, Title, Top, Bottom, ..., Help }
- enum DecorationState { Normal, Disabled, Hover, Pressed }

### Public Functions

- QDecoration ()
- virtual ~QDecoration ()
- virtual void buildSysMenu ( QWidget * widget, QMenu * menu )
- void menuTriggered ( QWidget * widget, QAction * action )
- virtual bool paint ( QPainter * painter, const QWidget * widget, int decorationRegion = All, DecorationState state = Normal ) = 0
- virtual QRegion region ( const QWidget * widget, const QRect & rect, int type = All ) = 0
- QRegion region ( const QWidget * w, int decorationRegion = All )
- virtual int regionAt ( const QWidget * w, const QPoint & point )
- virtual void regionClicked ( QWidget * widget, int reg )
- virtual void regionDoubleClicked ( QWidget * widget, int region )

### Static Public Members

- void startMove ( QWidget * widget )
- void startResize ( QWidget * widget )

## Detailed Description

The QDecoration class allows the appearance of the Qt/Embedded Window Manager to be customized.

Qt/Embedded provides window management to top level windows. The appearance of the borders and buttons (the decoration) around the managed windows can be customized by creating your own class derived from QDecoration and overriding a few methods.

This class is non-portable. It is available only in Qt/Embedded.

See also QApplication::qwsSetDecoration().

## Member Type Documentation

### enum QDecoration::DecorationRegion

This enum describes the regions in the window decorations.

Constant | Value | Description
--- | --- | ---
`QDecoration::All` | `0x7fffffff` | the entire region used by the window decoration.
`QDecoration::Title` | `0x0000000200` | displays the window title and allows the window to be moved by dragging.
`QDecoration::Top` | `0x0000000002` | allows the top of the window to be resized.
`QDecoration::Bottom` | `0x0000000040` | allows the bottom of the window to be resized.
`QDecoration::Left` | `0x0000000008` | allows the left edge of the window to be resized.
`QDecoration::Right` | `0x0000000010` | allows the right edge of the window to be resized.
`QDecoration::TopLeft` | `0x0000000001` | allows the top-left of the window to be resized.
`QDecoration::TopRight` | `0x0000000004` | allows the top-right of the window to be resized.
`QDecoration::BottomLeft` | `0x0000000020` | allows the bottom-left of the window to be resized.
`QDecoration::BottomRight` | `0x0000000080` | allows the bottom-right of the window to be resized.
`QDecoration::Close` | `0x0000004000` | clicking in this region closes the window.
`QDecoration::Minimize` | `0x0000000800` | clicking in this region minimizes the window.
`QDecoration::Maximize` | `0x0000001000` | clicking in this region maximizes the window.
`QDecoration::Normalize` | `0x0000002000` | returns a maximized window to its previous size.
`QDecoration::Menu` | `0x0000000100` | clicking in this region opens the window operations (system) menu.
`QDecoration::Help` | `0x0000000400` | clicking in this region provides context-sensitive help.

### enum QDecoration::DecorationState

## Member Function Documentation

### QDecoration::QDecoration ()

Constructs a decorator.

### QDecoration::~QDecoration () `[virtual]`

Destroys a decorator.

### void QDecoration::buildSysMenu ( QWidget * widget, QMenu * menu ) `[virtual]`

Builds the system menu for the TLW widget.

### void QDecoration::menuTriggered ( QWidget * widget, QAction * action )

### bool QDecoration::paint ( QPainter * painter, const QWidget * widget, int decorationRegion = All, DecorationState state = Normal ) `[pure virtual]`

)

Override to paint the border and title decoration around widget using painter.

### QRegion QDecoration::region ( const QWidget * widget, const QRect & rect, int type = All ) `[pure virtual]`

Returns the requested region type which will contain widget with geometry rect.

### QRegion QDecoration::region ( const QWidget * w, int decorationRegion = All )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

### int QDecoration::regionAt ( const QWidget * w, const QPoint & point ) `[virtual]`

Returns first region which contains point. If none of the regions contain the point it returns None.

### void QDecoration::regionClicked ( QWidget * widget, int reg ) `[virtual]`

Performs the action for when region is clicked. Also used for items clicked in the system menu.

### void QDecoration::regionDoubleClicked ( QWidget * widget, int region ) `[virtual]`

### void QDecoration::startMove ( QWidget * widget ) `[static]`

Initiates move mode for the TLW handled by QWSManager.

### void QDecoration::startResize ( QWidget * widget ) `[static]`

Initiates resize mode for the TLW handled by QWSManager.