QCommonStyle类

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

头文件 #include <QCommonStyle>
CMakefind_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmakeQT += widgets
继承 QStyle
继承自

QProxyStyle

公共函数

重实现公共函数

虚拟voiddrawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget = nullptr) const override
虚拟voiddrawControl(QStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *widget = nullptr) const override
虚拟voiddrawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *widget = nullptr) const override
虚拟QPixmapgeneratedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
虚拟QStyle::SubControlhitTestComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget = nullptr) const override
虚拟intlayoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override
虚拟intpixelMetric(QStyle::PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override
虚拟voidpolish(QPalette &pal) override
虚拟voidpolish(QApplication *app) override
虚拟voidpolish(QWidget *widget) override
虚拟QSizesizeFromContents(QStyle::ContentsType contentsType, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget = nullptr) const override
虚拟QPixmapstandardPixmap(QStyle::StandardPixmap sp, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override
虚拟intstyleHint(QStyle::StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *hret = nullptr) const override
虚拟QRectsubControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *widget = nullptr) const override
虚拟QRectsubElementRect(QStyle::SubElement sr, const QStyleOption *opt, const QWidget *widget = nullptr) const override
虚拟voidunpolish(QWidget *widget) override
虚拟voidunpolish(QApplication *application) override

详细说明

此抽象类实现了Qt提供并作为其部分装箱的GUI样式实现的某些控件外观。

由于QCommonStyle继承了QStyle,其在QStyle文档中有详细说明。

另请参阅QStyleQProxyStyle

成员函数文档

QCommonStyle()

构造一个 QCommonStyle。

[virtual noexcept] ~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.

[重写虚函数] 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.

[重写虚函数] 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.

[重写虚函数] void QCommonStyle::polish(QPalette &pal)

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

[重写虚函数] void QCommonStyle::polish(QApplication *app)

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

[重写虚函数] void QCommonStyle::polish(QWidget *widget)

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

[重写虚函数] 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.

[重写虚函数] 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.

[重写虚拟] 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.

[重写虚拟] 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.

[重写虚拟] 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.

[重写虚拟] void QCommonStyle::unpolish(QWidget *widget)

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

[重写虚拟] void QCommonStyle::unpolish(QApplication *application)

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

© 2024 The Qt Company Ltd. 本文件中包含的文档贡献为各自所有者的版权。所提供的文档根据自由软件基金会发布的 GNU 自由文档许可协议版本 1.3 的条款进行许可。Qt 及相关商标为 The Qt Company Ltd. 在芬兰和/或其他国家的商标。所有其他商标均为各自所有者的财产。