QStyleOptionFrame 类

QStyleOptionFrame 类是用于绘制框架的描述参数。 更多...

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

公共类型

enum FrameFeature { None, Flat, Rounded }
flags FrameFeatures
enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

公共函数

QStyleOptionFrame ()
QStyleOptionFrame (const QStyleOptionFrame & other )

公共变量

QStyleOptionFrame::FrameFeatures features
QFrame::Shape frameShape
int lineWidth
int midLineWidth

详细描述

QStyleOptionFrame is used for drawing several built-in Qt widgets, including QFrame , QGroupBox , QLineEdit ,和 QMenu .

出于性能原因,有很少成员函数,且对成员变量的访问是直接的 (即:使用 . or -> 运算符)。这使结构易于使用并强调这些只需通过样式函数使用参数。

An instance of the QStyleOptionFrame class has type SO_Frame and version 3.

类型内部使用通过 QStyleOption ,其子类,和 qstyleoption_cast () to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles. The version is used by QStyleOption 子类以实现扩展在不破坏兼容性的情况下。若使用 qstyleoption_cast (),通常不需要校验它。

对于可以如何使用样式选项的演示范例,见 样式 范例。

另请参阅 QStyleOption .

成员类型文档编制

enum QStyleOptionFrame:: FrameFeature
flags QStyleOptionFrame:: FrameFeatures

This enum describes the different types of features a frame can have.

常量 描述
QStyleOptionFrame::None 0x00 Indicates a normal frame.
QStyleOptionFrame::Flat 0x01 Indicates a flat frame.
QStyleOptionFrame::Rounded 0x02 Indicates a rounded frame.

The FrameFeatures type is a typedef for QFlags <FrameFeature>. It stores an OR combination of FrameFeature values.

enum QStyleOptionFrame:: StyleOptionType

This enum is used to hold information about the type of the style option, and is defined for each QStyleOption 子类。

常量 描述
QStyleOptionFrame::Type SO_Frame 提供样式选项的类型 ( SO_Frame 对于此类)。

类型内部使用通过 QStyleOption ,其子类,和 qstyleoption_cast () to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.

另请参阅 StyleOptionVersion .

enum QStyleOptionFrame:: StyleOptionVersion

This enum is used to hold information about the version of the style option, and is defined for each QStyleOption 子类。

常量 描述
QStyleOptionFrame::Version 1 3

版本的使用通过 QStyleOption 子类以实现扩展在不破坏兼容性的情况下。若使用 qstyleoption_cast (),通常不需要校验它。

另请参阅 StyleOptionType .

成员函数文档编制

QStyleOptionFrame:: QStyleOptionFrame ()

Constructs a QStyleOptionFrame, initializing the members variables to their default values.

QStyleOptionFrame:: QStyleOptionFrame (const QStyleOptionFrame & other )

构造副本为 other 样式选项。

成员变量文档编制

QStyleOptionFrame::FrameFeatures QStyleOptionFrame:: features

This variable holds a bitwise OR of the features that describe this frame.

另请参阅 FrameFeature .

QFrame::Shape QStyleOptionFrame:: frameShape

This property holds the frame shape value of the frame.

另请参阅 QFrame::frameShape .

int QStyleOptionFrame:: lineWidth

This variable holds the line width for drawing the frame

默认值为 0。

另请参阅 QFrame::lineWidth .

int QStyleOptionFrame:: midLineWidth

This variable holds the mid-line width for drawing the frame

This is usually used in drawing sunken or raised frames.

默认值为 0。

另请参阅 QFrame::midLineWidth .