QStyleFactory 类

QStyleFactory 类创建 QStyle 对象。 更多...

头: #include <QStyleFactory>
qmake: QT += widgets

静态公共成员

QStyle * create (const QString & key )
QStringList keys ()

详细描述

QStyle 类是封装 GUI 外观和感觉的抽象基类。QStyleFactory 创建 QStyle 对象使用 create () 函数和键标识样式。样式要么内置,要么从样式插件动态加载 (见 QStylePlugin ).

可以检索有效键使用 keys () function. Typically they include "windows" and "fusion". Depending on the platform, "windowsvista" and "macintosh" may be available. Note that keys are case insensitive.

另请参阅 QStyle .

成员函数文档编制

[static] QStyle *QStyleFactory:: create (const QString & key )

创建和返回 QStyle 对象匹配给定 key ,或返回 nullptr 若未找到匹配样式。

内置样式和来自样式插件的样式两者会被查询为匹配样式。

注意: 键的使用不区分大小写。

另请参阅 keys ().

[static] QStringList QStyleFactory:: keys ()

返回有效键 (即:此工厂可以创建的样式键) 的列表。

另请参阅 create ().