CommonStyle Class

CommonStyle is an intermediate class between Qt styles and Qtitan styles. It implements a set of basic mechanisms for the work for styles used in the components of Qtitan. It is used for working with the palette, reading XML config files, basic functions and settings. More...

Header: #include <CommonStyle>
Inherits: QProxyStyle
Inherited By:

AdobePhotoshopStyle, ColorizedStyle, OfficeStyle, and VisualStudio2019Style

Public Types

Properties

Public Functions

CommonStyle(QStyle *style = Q_NULL)
bool isAnimationEnabled() const
bool isDialogsIgnored() const
bool isScrollBarsIgnored() const
void setAnimationEnabled(bool enabled = true)
void setDialogsIgnored(bool ignore = false)
void setScrollBarsIgnored(bool ignore = false)

Reimplemented Public Functions

virtual void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w = QWIDGET_NULL) const override
virtual void drawControl(QStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = QWIDGET_NULL) const override
virtual void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = QWIDGET_NULL) const override
virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
virtual QStyle::SubControl hitTestComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w = QWIDGET_NULL) const override
virtual QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override
virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const override
virtual int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const override
virtual int pixelMetric(QStyle::PixelMetric metric, const QStyleOption *opt = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const override
virtual void polish(QPalette &palette) override
virtual void polish(QApplication *app) override
virtual void polish(QWidget *widget) override
virtual QSize sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = QWIDGET_NULL) const override
virtual QIcon standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *opt = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const override
virtual QPalette standardPalette() const override
virtual QPixmap standardPixmap(QStyle::StandardPixmap sp, const QStyleOption *opt = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const override
virtual int styleHint(QStyle::StyleHint hint, const QStyleOption *option = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL, QStyleHintReturn *returnData = Q_NULL) const override
virtual QRect subControlRect(QStyle::ComplexControl control, const QStyleOptionComplex *option, QStyle::SubControl subControl, const QWidget *widget = QWIDGET_NULL) const override
virtual QRect subElementRect(QStyle::SubElement se, const QStyleOption *option, const QWidget *widget = QWIDGET_NULL) const override
virtual void unpolish(QApplication *app) override
virtual void unpolish(QWidget *widget) override

Reimplemented Protected Functions

virtual bool event(QEvent *event) override
virtual bool eventFilter(QObject *watched, QEvent *event) override

Detailed Description

Property Documentation

animationEnabled : bool

Sets the animation for widgets and controls when mouse over the elements to enable state. By default the animation is enabled.

Access functions:

bool isAnimationEnabled() const
void setAnimationEnabled(bool enabled = true)

ignoreDialogs : bool

Sets ignore dialog flag. If this flag is true that can ignore the current Ribbon or Office Style for dialogs and standard Qt style will be used for dialog. By default this flag is false.

Access functions:

bool isDialogsIgnored() const
void setDialogsIgnored(bool ignore = false)

ignoreScrollBars : bool

Sets ignore scroll bars flag. It is usefull if necessary to create an application more natively. By default this value is false.

Access functions:

bool isScrollBarsIgnored() const
void setScrollBarsIgnored(bool ignore = false)

Member Function Documentation

CommonStyle::CommonStyle(QStyle *style = Q_NULL)

Constuctor of CommonStyle class. You can't use this class directly.

[override virtual] void CommonStyle::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w = QWIDGET_NULL) const

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

[override virtual] void CommonStyle::drawControl(QStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = QWIDGET_NULL) const

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

[override virtual] void CommonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = QWIDGET_NULL) const

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

[override virtual protected] bool CommonStyle::event(QEvent *event)

Reimplements: QProxyStyle::event(QEvent *e).

[override virtual protected] bool CommonStyle::eventFilter(QObject *watched, QEvent *event)

Reimplements: QObject::eventFilter(QObject *watched, QEvent *event).

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

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

[override virtual] QStyle::SubControl CommonStyle::hitTestComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w = QWIDGET_NULL) const

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

bool CommonStyle::isAnimationEnabled() const

Returns animation state for Microsoft Office's controls when mouse over the elements.

Note: Getter function for property animationEnabled.

bool CommonStyle::isDialogsIgnored() const

Returns the ignore dialog flag.

Note: Getter function for property ignoreDialogs.

bool CommonStyle::isScrollBarsIgnored() const

Returns the value of ignore scroll bars flag.

Note: Getter function for property ignoreScrollBars.

[override virtual] QRect CommonStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const

Reimplements: QProxyStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const.

[override virtual] QRect CommonStyle::itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const

Reimplements: QProxyStyle::itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const.

[override virtual] int CommonStyle::layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const

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

[override virtual] int CommonStyle::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *opt = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const

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

[override virtual] void CommonStyle::polish(QPalette &palette)

Reimplements: QProxyStyle::polish(QPalette &pal).

[override virtual] void CommonStyle::polish(QApplication *app)

Reimplements: QProxyStyle::polish(QApplication *app).

[override virtual] void CommonStyle::polish(QWidget *widget)

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

[override virtual] QSize CommonStyle::sizeFromContents(QStyle::ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = QWIDGET_NULL) const

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

[override virtual] QIcon CommonStyle::standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *opt = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const

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

[override virtual] QPalette CommonStyle::standardPalette() const

Reimplements: QProxyStyle::standardPalette() const.

[override virtual] QPixmap CommonStyle::standardPixmap(QStyle::StandardPixmap sp, const QStyleOption *opt = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL) const

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

[override virtual] int CommonStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option = QSTYLEOPTION_NULL, const QWidget *widget = QWIDGET_NULL, QStyleHintReturn *returnData = Q_NULL) const

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

[override virtual] QRect CommonStyle::subControlRect(QStyle::ComplexControl control, const QStyleOptionComplex *option, QStyle::SubControl subControl, const QWidget *widget = QWIDGET_NULL) const

Reimplements: QProxyStyle::subControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex *option, QStyle::SubControl sc, const QWidget *widget) const.

[override virtual] QRect CommonStyle::subElementRect(QStyle::SubElement se, const QStyleOption *option, const QWidget *widget = QWIDGET_NULL) const

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

[override virtual] void CommonStyle::unpolish(QApplication *app)

Reimplements: QProxyStyle::unpolish(QApplication *app).

[override virtual] void CommonStyle::unpolish(QWidget *widget)

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