QStyleOptionRubberBand Class

QStyleOptionRubberBand 类用于描述绘制橡皮筋所需的参数。更多

Header: #include <QStyleOptionRubberBand>
CMake.QStyleOptionRubberBand 类 find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QStyleOption

公共类型

enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

公共函数

QStyleOptionRubberBand()
QStyleOptionRubberBand(const QStyleOptionRubberBand &other)

公共变量

bool opaque
QRubberBand::Shape shape

详细说明

QStyleOptionRubberBand 包含QStyle 函数绘制QRubberBand 所需的所有信息。

出于性能考虑,成员函数很少,对成员变量的访问是直接的(即使用.-> 操作符)。这使得结构使用起来更加简单明了,并强调这些结构只是样式函数使用的参数。

另请参见 QStyleOptionQRubberBand

成员类型文档

enum QStyleOptionRubberBand::StyleOptionType

该枚举用于保存有关样式选项类型的信息,并为每个QStyleOption 子类定义。

常量描述
QStyleOptionRubberBand::TypeSO_RubberBand提供的样式选项的类型(SO_RubberBand 适用于该类)。

QStyleOption 及其子类和qstyleoption_cast() 内部使用该类型来确定样式选项的类型。一般来说,除非您想创建自己的QStyleOption 子类和自己的样式,否则不需要担心这个问题。

另请参见 StyleOptionVersion

enum QStyleOptionRubberBand::StyleOptionVersion

该枚举用于保存有关样式选项版本的信息,并为每个QStyleOption 子类定义。

常量说明
QStyleOptionRubberBand::Version11

版本用于QStyleOption 子类在不破坏兼容性的情况下实现扩展。如果使用qstyleoption_cast() ,通常不需要检查它。

另请参阅 StyleOptionType

成员函数文档

QStyleOptionRubberBand::QStyleOptionRubberBand()

创建 QStyleOptionRubberBand,将成员变量初始化为默认值。

QStyleOptionRubberBand::QStyleOptionRubberBand(const QStyleOptionRubberBand &other)

构建other 样式选项的副本。

成员变量文档

bool QStyleOptionRubberBand::opaque

该变量用于保存是否要求以不透明样式绘制橡皮筋。

默认值为 true。

QRubberBand::Shape QStyleOptionRubberBand::shape

该变量用于保存橡皮筋的形状

默认形状为QRubberBand::Line

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.