The QPictureFormatPlugin class provides an abstract base for custom picture format plugins. 更多...
头: | #include <QPictureFormatPlugin> |
qmake: | QT += gui |
继承: | QObject |
该类已过时。 提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。
QPictureFormatPlugin (QObject * parent = nullptr) | |
virtual | ~QPictureFormatPlugin () |
virtual bool | installIOHandler (const QString & format ) = 0 |
virtual bool | loadPicture (const QString & format , const QString & fileName , QPicture * picture ) |
virtual bool | savePicture (const QString & format , const QString & fileName , const QPicture & picture ) |
The picture format plugin is a simple plugin interface that makes it easy to create custom picture formats that can be used transparently by applications.
Writing an picture format plugin is achieved by subclassing this base class, reimplementing the pure virtual functions loadPicture (), savePicture (),和 installIOHandler (),和导出类采用 Q_PLUGIN_METADATA () 宏。
The json file containing the metadata should contain one entry with the list of picture formats supported by the plugin:
{ "Keys": [ "mypictureformat" ] }
另请参阅 如何创建 Qt 插件 .
Constructs an picture format plugin with the given parent . This is invoked automatically by the moc generated code that exports the plugin.
[虚拟]
QPictureFormatPlugin::
~QPictureFormatPlugin
()
销毁图片格式插件。
从不需要明确调用这。Qt 自动销毁插件当不再使用时。
[pure virtual]
bool
QPictureFormatPlugin::
installIOHandler
(const
QString
&
format
)
Installs a QPictureIO picture I/O handler for the picture format
format
。返回
true
当成功时。
[虚拟]
bool
QPictureFormatPlugin::
loadPicture
(const
QString
&
format
, const
QString
&
fileName
,
QPicture
*
picture
)
Loads the picture stored in the file called
fileName
,采用给定
format
, into *
picture
。返回
true
当成功时;否则返回
false
.
另请参阅 savePicture ().
[虚拟]
bool
QPictureFormatPlugin::
savePicture
(const
QString
&
format
, const
QString
&
fileName
, const
QPicture
&
picture
)
Saves the given
picture
into the file called
fileName
,使用指定
format
。返回
true
当成功时;否则返回
false
.
另请参阅 loadPicture ().