[QtGui module]

该QStyleOptionFrameV2类是用来描述用于绘制Qt中4.1或更高的帧所必需的参数。More…

继承QStyleOptionFrame

通过继承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部件,包括QFrameQGroupBoxQLineEditQMenu

该QStyleOptionFrameV2类的实例有type SO_Frameversion2 。该类型在内部使用QStyleOption,它的子类,并qstyleoption_cast()来确定的样式选项的类型。一般来说,你不需要担心这个,除非你想创建自己的QStyleOption子类和你自己的风格。的版本是由QStyleOption子类实现不破坏兼容性扩展。如果你使用qstyleoption_cast( ) ,你通常并不需要检查它。

如果您创建自己的QStyle子类,你应该同时处理QStyleOptionFrame和QStyleOptionFrameV2 。实现这一目标的方法之一是使用QStyleOptionFrameV2拷贝构造函数。例如:

  1. [QStyleOptionFrame](docs_qstyleoptionframe.html) *option;
  2. if (const [QStyleOptionFrame](docs_qstyleoptionframe.html) *frameOption =
  3. qstyleoption_cast<const [QStyleOptionFrame](docs_qstyleoptionframe.html) *>(option)) {
  4. QStyleOptionFrameV2 frameOptionV2(*frameOption);
  5. // draw the frame using frameOptionV2
  6. }

在上面的例子:如果frameOption的版本号是1,FrameFeature被设置为NoneframeOptionV2。如果frameOption的版本是2 ,构造函数会简单地复制frameOptionFrameFeature值。

举一个例子展示风格选择如何使用,请参阅Styles例子。


Type Documentation

  1. QStyleOptionFrameV2.FrameFeature

这个枚举变量描述了不同类型的功能框可以有。

Constant Value Description
QStyleOptionFrameV2.None 0x00 表示正常帧。
QStyleOptionFrameV2.Flat 0x01 表示一个平面框架。

该FrameFeatures类型是一个typedef为QFlags\u003cFrameFeature\u003e 。它存储FrameFeature值的或组合。

  1. QStyleOptionFrameV2.StyleOptionVersion

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

Constant Value Description
QStyleOptionFrameV2.Version 2 2

的版本是由QStyleOption子类实现不破坏兼容性扩展。如果你使用qstyleoption_cast( ) ,你通常并不需要检查它。

See also StyleOptionType


Method Documentation

  1. QStyleOptionFrameV2.__init__ (self)

构造一个QStyleOptionFrameV2对象。

  1. QStyleOptionFrameV2.__init__ (self, QStyleOptionFrameV2 other)

构造一个QStyleOptionFrameV2副本other样式选项。

  1. QStyleOptionFrameV2.__init__ (self, QStyleOptionFrame other)

构造一个QStyleOptionFrameV2副本other它可以是风格的选择QStyleOptionFrameV2 or QStyleOptionFrame类型。

如果other风格选择的版本是1 ,新样式选项的FrameFeature值被设置为QStyleOptionFrameV2.None。如果它的版本为2时,其FrameFeature值被简单地复制到新的样式选项。

See also version


Member Documentation

  1. FrameFeatures features

[

这个变量保存的描述这个框架的功能的按位或。

](docs_index.htm)

See also FrameFeature