QIconEnginePlugin Class

The QIconEnginePlugin class provides an abstract base for custom QIconEngine 插件。 更多...

頭: #include <QIconEnginePlugin>
qmake: QT += gui
繼承: QObject

公共函數

QIconEnginePlugin (QObject * parent = nullptr)
virtual ~QIconEnginePlugin ()
virtual QIconEngine * create (const QString & filename = QString()) = 0

詳細描述

The icon engine plugin is a simple plugin interface that makes it easy to create custom icon engines that can be loaded dynamically into applications through QIcon . QIcon uses the file or resource name's suffix to determine what icon engine to use.

Writing a icon engine plugin is achieved by subclassing this base class, reimplementing the pure virtual function create (),和導齣類采用 Q_PLUGIN_METADATA () 宏。

The json metadata should contain a list of icon engine keys that this plugin supports. The keys correspond to the suffix of the file or resource name used when the plugin was created. Keys are case insensitive.

{ "Keys": [ "myiconengine" ] }
					

另請參閱 如何創建 Qt 插件 .

成員函數文檔編製

QIconEnginePlugin:: QIconEnginePlugin ( QObject * parent = nullptr)

Constructs a icon engine plugin with the given parent 。這被插件加載程序自動援引。

[虛擬] QIconEnginePlugin:: ~QIconEnginePlugin ()

Destroys the icon engine plugin.

從不需要明確調用這。Qt 自動銷毀插件當不再使用時。

[pure virtual] QIconEngine *QIconEnginePlugin:: create (const QString & filename = QString())

創建並返迴 QIconEngine object for the icon with the given filename .