QPictureFormatPlugin Class

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 插件 .

成員函數文檔編製

QPictureFormatPlugin:: QPictureFormatPlugin ( QObject * parent = nullptr)

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 ().