[QtGui module]
该QStyleOptionFrameV2类是用来描述用于绘制Qt中4.1或更高的帧所必需的参数。More…
通过继承QStyleOptionFrameV3。
Types
enum FrameFeature { None, Flat }
class **[FrameFeatures](docs_index.htm)**
enum StyleOptionVersion { Version }
Methods
__init__ (self)
__init__ (self, QStyleOptionFrameV2 other)
__init__ (self, QStyleOptionFrame other)
Members
FrameFeatures **[features](docs_qstyleoptionframev2.html#features-var)**
Detailed Description
该QStyleOptionFrameV2类是用来描述用于绘制Qt中4.1或更高的帧所必需的参数。
QStyleOptionFrameV2继承QStyleOptionFrame这是用于绘制几个内置的Qt部件,包括QFrame,QGroupBox,QLineEdit和QMenu。
该QStyleOptionFrameV2类的实例有type SO_Frame和version2 。该类型在内部使用QStyleOption,它的子类,并qstyleoption_cast()来确定的样式选项的类型。一般来说,你不需要担心这个,除非你想创建自己的QStyleOption子类和你自己的风格。的版本是由QStyleOption子类实现不破坏兼容性扩展。如果你使用qstyleoption_cast( ) ,你通常并不需要检查它。
如果您创建自己的QStyle子类,你应该同时处理QStyleOptionFrame和QStyleOptionFrameV2 。实现这一目标的方法之一是使用QStyleOptionFrameV2拷贝构造函数。例如:
[QStyleOptionFrame](docs_qstyleoptionframe.html) *option;
if (const [QStyleOptionFrame](docs_qstyleoptionframe.html) *frameOption =
qstyleoption_cast<const [QStyleOptionFrame](docs_qstyleoptionframe.html) *>(option)) {
QStyleOptionFrameV2 frameOptionV2(*frameOption);
// draw the frame using frameOptionV2
}
在上面的例子:如果frameOption
的版本号是1,FrameFeature被设置为None为frameOptionV2
。如果frameOption
的版本是2 ,构造函数会简单地复制frameOption
的FrameFeature值。
举一个例子展示风格选择如何使用,请参阅Styles例子。
Type Documentation
QStyleOptionFrameV2.FrameFeature
这个枚举变量描述了不同类型的功能框可以有。
Constant | Value | Description |
---|---|---|
QStyleOptionFrameV2.None |
0x00 |
表示正常帧。 |
QStyleOptionFrameV2.Flat |
0x01 |
表示一个平面框架。 |
该FrameFeatures类型是一个typedef为QFlags\u003cFrameFeature\u003e 。它存储FrameFeature值的或组合。
QStyleOptionFrameV2.StyleOptionVersion
此枚举是用来保存有关样式选项的版本信息,并定义每个QStyleOption子类。
Constant | Value | Description |
---|---|---|
QStyleOptionFrameV2.Version |
2 |
2 |
的版本是由QStyleOption子类实现不破坏兼容性扩展。如果你使用qstyleoption_cast( ) ,你通常并不需要检查它。
See also StyleOptionType。
Method Documentation
QStyleOptionFrameV2.__init__ (self)
构造一个QStyleOptionFrameV2对象。
QStyleOptionFrameV2.__init__ (self, QStyleOptionFrameV2 other)
构造一个QStyleOptionFrameV2副本other样式选项。
QStyleOptionFrameV2.__init__ (self, QStyleOptionFrame other)
构造一个QStyleOptionFrameV2副本other它可以是风格的选择QStyleOptionFrameV2 or QStyleOptionFrame类型。
如果other风格选择的版本是1 ,新样式选项的FrameFeature值被设置为QStyleOptionFrameV2.None。如果它的版本为2时,其FrameFeature值被简单地复制到新的样式选项。
See also version。
Member Documentation
FrameFeatures features
[
这个变量保存的描述这个框架的功能的按位或。
](docs_index.htm)