QCommonStyle 类

QCommonStyle 类封装 GUI 的公共外观和感觉。 更多...

头: #include <QCommonStyle>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QStyle
继承者:

QProxyStyle

公共函数

QCommonStyle ()
virtual ~QCommonStyle ()

重实现公共函数

virtual void drawComplexControl (QStyle::ComplexControl cc , const QStyleOptionComplex * opt , QPainter * p , const QWidget * widget = nullptr) const override
virtual void drawControl (QStyle::ControlElement element , const QStyleOption * opt , QPainter * p , const QWidget * widget = nullptr) const override
virtual void drawPrimitive (QStyle::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 QStyle::SubControl hitTestComplexControl (QStyle::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 (QStyle::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 (QStyle::ContentsType contentsType , const QStyleOption * opt , const QSize & contentsSize , const QWidget * widget = nullptr) const override
virtual QPixmap standardPixmap (QStyle::StandardPixmap sp , const QStyleOption * option = nullptr, const QWidget * widget = nullptr) const override
virtual int styleHint (QStyle::StyleHint sh , const QStyleOption * opt = nullptr, const QWidget * widget = nullptr, QStyleHintReturn * hret = nullptr) const override
virtual QRect subControlRect (QStyle::ComplexControl cc , const QStyleOptionComplex * opt , QStyle::SubControl sc , const QWidget * widget = nullptr) const override
virtual QRect subElementRect (QStyle::SubElement sr , const QStyleOption * opt , const QWidget * widget = nullptr) const override
virtual void unpolish (QWidget * widget ) override
virtual void unpolish (QApplication * application ) override

详细描述

此抽象类实现作为 Qt 的一部分提供并随附了所有 GUI 样式所公共的一些 Widget 外观和感觉。

由于 QCommonStyle 继承 QStyle ,它的所有函数的完整文档是在 QStyle 文档编制。

另请参阅 QStyle and QProxyStyle .

成员函数文档编制

QCommonStyle:: QCommonStyle ()

构造 QCommonStyle。

[virtual noexcept] QCommonStyle:: ~QCommonStyle ()

销毁样式。

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

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

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

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

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

重实现: QStyle::drawPrimitive(QStyle::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

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

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

重实现: QStyle::hitTestComplexControl(QStyle::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

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

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

重实现: QStyle::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const .

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

重实现: QStyle::polish (QPalette &palette).

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

重实现: QStyle::polish (QApplication *application).

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

重实现: QStyle::polish (QWidget *widget).

[override virtual] QSize QCommonStyle:: sizeFromContents ( QStyle::ContentsType contentsType , const QStyleOption * opt , const QSize & contentsSize , const QWidget * widget = nullptr) const

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

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

重实现: QStyle::standardPixmap(QStyle::StandardPixmap standardPixmap, const QStyleOption *option, const QWidget *widget) const .

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

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

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

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

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

重实现: QStyle::subElementRect(QStyle::SubElement element, const QStyleOption *option, const QWidget *widget) const .

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

重实现: QStyle::unpolish (QWidget *widget).

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

重实现: QStyle::unpolish (QApplication *application).