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>

- List of all members, including inherited members

### Public Types

- enum Region { All, Title, Top, Bottom, Left, ..., Menu }

### Public Functions

- QDecoration ()
- virtual ~QDecoration ()
- virtual void close ( QWidget * widget )
- virtual void maximize ( QWidget * widget )
- virtual void minimize ( QWidget * widget )
- virtual void paint ( QPainter * painter, const QWidget * widget ) = 0
- virtual void paintButton ( QPainter * painter, const QWidget * widget, Region type, int state ) = 0
- virtual QRegion region ( const QWidget * widget, const QRect & rect, Region type = All ) = 0

## 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::Region

This enum describes the regions in the window decorations.

`QDecoration::All` | the entire region used by the window decoration.
`QDecoration::Title` | displays the window title and allows the window to be moved by dragging.
`QDecoration::Top` | allows the top of the window to be resized.
`QDecoration::Bottom` | allows the bottom of the window to be resized.
`QDecoration::Left` | allows the left edge of the window to be resized.
`QDecoration::Right` | allows the right edge of the window to be resized.
`QDecoration::TopLeft` | allows the top-left of the window to be resized.
`QDecoration::TopRight` | allows the top-right of the window to be resized.
`QDecoration::BottomLeft` | allows the bottom-left of the window to be resized.
`QDecoration::BottomRight` | allows the bottom-right of the window to be resized.
`QDecoration::Close` | clicking in this region closes the window.
`QDecoration::Minimize` | clicking in this region minimizes the window.
`QDecoration::Maximize` | clicking in this region maximizes the window.
`QDecoration::Normalize` | returns a maximized window to its previous size.
`QDecoration::Menu` | clicking in this region opens the window operations (system) menu.

## Member Function Documentation

### QDecoration::QDecoration ()

Constructs a decorator.

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

Destroys a decorator.

### void QDecoration::close ( QWidget * widget ) `[virtual]`

Called when the user clicks in the `Close` region.

widget is the widget to be closed.

The default behavior is to close the widget.

### void QDecoration::maximize ( QWidget * widget ) `[virtual]`

Called when the user clicks in the `Maximize` region.

widget is the widget to be maximized.

The default behavior is to resize the widget to be full-screen. This method can be overridden e.g. to allow room for launch panels.

### void QDecoration::minimize ( QWidget * widget ) `[virtual]`

Called when the user clicks in the `Minimize` region.

widget is the widget to be minimized.

The default behavior is to ignore this action.

### void QDecoration::paint ( QPainter * painter, const QWidget * widget ) `[pure virtual]`

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

### void QDecoration::paintButton ( QPainter * painter, const QWidget * widget, Region type, int state ) `[pure virtual]`

Override to paint a button of type type using painter.

widget is the widget whose button is to be drawn. state is the state of the button. It can be a combination of the following OR-ed together:

- `QWSButton::MouseOver`
- `QWSButton::Clicked`
- `QWSButton::On`

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

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