- Qt 5.15
- Qt Widgets
- C++ Classes
- QCommonStyle
- Qt 5.15.18 Reference Documentation

# QCommonStyle Class

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

Header: | #include <QCommonStyle>
qmake: | QT += widgets
Inherits: | QStyle
Inherited By: | QProxyStyle

- List of all members, including inherited members

## Public Functions

| QCommonStyle()
virtual | ~QCommonStyle()

## Reimplemented Public Functions

virtual void | drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget = nullptr) const override
virtual void | drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *widget = nullptr) const override
virtual void | drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *widget = nullptr) const override
virtual QPixmap | generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
virtual SubControl | hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget = nullptr) const override
virtual int | layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override
virtual int | pixelMetric(PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override
virtual void | polish(QPalette &pal) override
virtual void | polish(QApplication *app) override
virtual void | polish(QWidget *widget) override
virtual QSize | sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget = nullptr) const override
virtual QPixmap | standardPixmap(StandardPixmap sp, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override
virtual int | styleHint(StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *hret = nullptr) const override
virtual QRect | subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget = nullptr) const override
virtual QRect | subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget = nullptr) const override
virtual void | unpolish(QWidget *widget) override
virtual void | unpolish(QApplication *application) override

## Detailed Description

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.

Since QCommonStyle inherits QStyle, all of its functions are fully documented in the QStyle documentation.

See also QStyle and QProxyStyle.

## Member Function Documentation

### QCommonStyle::QCommonStyle()

Constructs a QCommonStyle.

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

Destroys the style.

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

Reimplements: QStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const.

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

Reimplements: QStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const.

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

Reimplements: QStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const.

### `[override virtual]` QPixmap QCommonStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const

Reimplements: QStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const.

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

Reimplements: QStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &position, const QWidget *widget) const.

### `[override virtual]` int QCommonStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const

Reimplements: QStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const.

### `[override virtual]` int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const

Reimplements: QStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const.

### `[override virtual]` void QCommonStyle::polish(QPalette &pal)

Reimplements: QStyle::polish(QPalette &palette).

### `[override virtual]` void QCommonStyle::polish(QApplication *app)

Reimplements: QStyle::polish(QApplication *application).

### `[override virtual]` void QCommonStyle::polish(QWidget *widget)

Reimplements: QStyle::polish(QWidget *widget).

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

Reimplements: QStyle::sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const.

### `[override virtual]` QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const

Reimplements: QStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option, const QWidget *widget) const.

### `[override virtual]` int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *hret = nullptr) const

Reimplements: QStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const.

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

Reimplements: QStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const.

### `[override virtual]` QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget = nullptr) const

Reimplements: QStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const.

### `[override virtual]` void QCommonStyle::unpolish(QWidget *widget)

Reimplements: QStyle::unpolish(QWidget *widget).

### `[override virtual]` void QCommonStyle::unpolish(QApplication *application)

Reimplements: QStyle::unpolish(QApplication *application).