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

# QCommonStyle Class Reference

The QCommonStyle class encapsulates the common Look and Feel of a GUI. More...

    #include <QCommonStyle>

Inherits QStyle.

Inherited by QMotifStyle and QWindowsStyle.

- List of all members, including inherited members

### Writable Properties

- 1 writable property inherited from QObject

### Public Functions

- QCommonStyle ()
- ~QCommonStyle ()
- virtual void drawComplexControl ( ComplexControl cc, const QStyleOptionComplex * opt, QPainter * p, const QWidget * widget = 0 ) const
- virtual void drawComplexControlMask ( ComplexControl cc, const QStyleOptionComplex * opt, QPainter * p, const QWidget * w = 0 ) const
- virtual void drawControl ( ControlElement ce, const QStyleOption * opt, QPainter * p, const QWidget * widget = 0 ) const
- virtual void drawControlMask ( ControlElement ce, const QStyleOption * opt, QPainter * p, const QWidget * w = 0 ) const
- virtual void drawPrimitive ( PrimitiveElement pe, const QStyleOption * opt, QPainter * p, const QWidget * widget = 0 ) const
- virtual SubControl querySubControl ( ComplexControl cc, const QStyleOptionComplex * opt, const QPoint & pt, const QWidget * widget = 0 ) const
- virtual QRect querySubControlMetrics ( ComplexControl cc, const QStyleOptionComplex * opt, SubControl sc, const QWidget * widget = 0 ) const
- virtual QSize sizeFromContents ( ContentsType ct, const QStyleOption * opt, const QSize & csz, const QFontMetrics & fm, const QWidget * widget = 0 ) const
- virtual QRect subRect ( SubRect sr, const QStyleOption * opt, const QFontMetrics & fm, const QWidget * widget = 0 ) const

- 23 public functions inherited from QStyle
- 24 public functions inherited from QObject

### Public Slots

- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 6 static public members inherited from QStyle
- 4 static public members inherited from QObject

### Protected Functions

- 9 protected functions inherited from QObject

## Detailed Description

The QCommonStyle class encapsulates the common Look and Feel of a GUI.

This abstract class implements some of the widget's look and feel that is common to all GUI styles provided and shipped as part of Qt.

All the functions are full documented in QStyle, although the extra functions that QCommonStyle provides, e.g. drawComplexControl(), drawComplexControlMask(), drawControl(), drawControlMask(), drawPrimitive(), querySubControl(), querySubControlMetrics(), sizeFromContents(), and subRect() are documented here.

## Member Function Documentation

### QCommonStyle::QCommonStyle ()

Constructs a QCommonStyle.

### QCommonStyle::~QCommonStyle ()

Destroys the style

### void QCommonStyle::drawComplexControl ( ComplexControl cc, const QStyleOptionComplex * opt, QPainter * p, const QWidget * widget = 0 ) const `[virtual]`

Draws the complex control cc, with style options opt, on painter p. The widget is optional and may contain a widget that is useful for drawing the primitive.

Reimplemented from QStyle.

### void QCommonStyle::drawComplexControlMask ( ComplexControl cc, const QStyleOptionComplex * opt, QPainter * p, const QWidget * w = 0 ) const `[virtual]`

Draws the mask for the given complex control cc, with style options opt, on painter p. The widget w is optional and may contain a widget that is useful for drawing the mask.

Reimplemented from QStyle.

### void QCommonStyle::drawControl ( ControlElement ce, const QStyleOption * opt, QPainter * p, const QWidget * widget = 0 ) const `[virtual]`

Draws the control ce, with style options opt, on painter p. The widget is optional and may contain a widget that is useful for drawing the control.

Reimplemented from QStyle.

### void QCommonStyle::drawControlMask ( ControlElement ce, const QStyleOption * opt, QPainter * p, const QWidget * w = 0 ) const `[virtual]`

Draws the mask for the given control ce, with style options opt, on painter p. The widget w is optional and may contain a widget that is useful for drawing the primitive.

Reimplemented from QStyle.

### void QCommonStyle::drawPrimitive ( PrimitiveElement pe, const QStyleOption * opt, QPainter * p, const QWidget * widget = 0 ) const `[virtual]`

Draws the primitive element pe, with style options opt, on painter p. The widget is optional and may contain a widget that is useful for drawing the primitive.

Reimplemented from QStyle.

### SubControl QCommonStyle::querySubControl ( ComplexControl cc, const QStyleOptionComplex * opt, const QPoint & pt, const QWidget * widget = 0 ) const `[virtual]`

Returns the sub-widget in the complex control cc, with style options opt, at point pt, and with parent widget widget.

Reimplemented from QStyle.

See also querySubControlMetrics().

### QRect QCommonStyle::querySubControlMetrics ( ComplexControl cc, const QStyleOptionComplex * opt, SubControl sc, const QWidget * widget = 0 ) const `[virtual]`

Returns the rectangle occupied by the complex control cc, with style options opt, sub-control sc. The widget is optional and may contain a widget that is useful for drawing the sub-control.

Reimplemented from QStyle.

See also querySubControl().

### QSize QCommonStyle::sizeFromContents ( ContentsType ct, const QStyleOption * opt, const QSize & csz, const QFontMetrics & fm, const QWidget * widget = 0 ) const `[virtual]`

Returns the size required by the contents of type ct, with style options opt, original size csz, font metrics fm. The widget is optional and may contain a widget that is useful for calculating the size.

Reimplemented from QStyle.

### QRect QCommonStyle::subRect ( SubRect sr, const QStyleOption * opt, const QFontMetrics & fm, const QWidget * widget = 0 ) const `[virtual]`

Returns the rectangle occupied by sub-rectangle sr, with style options opt and font metrics fm. The widget parameter is optional and may contain a widget that is useful for drawing the sub-rectangle.

Reimplemented from QStyle.