How to Create Qt Plugins▲
Qt provides two APIs for creating plugins:
-
A high-level API for writing extensions to Qt itself: custom database drivers, image formats, text codecs, custom styles, etc.
-
A low-level API for extending Qt applications.
For example, if you want to write a custom QStyle subclass and have Qt applications load it dynamically, you would use the higher-level API.
Since the higher-level API is built on top of the lower-level API, some issues are common to both.
If you want to provide plugins for use with Qt Designer, see the Qt Designer module documentation.
Topics:
The High-Level API: Writing Qt Extensions▲
Writing a plugin that extends Qt itself is achieved by subclassing the appropriate plugin base class, implementing a few functions, and adding a macro.
There are several plugin base classes. Derived plugins are stored by default in sub-directories of the standard plugin directory. Qt will not find plugins if they are not stored in the appropriate directory.
The following table summarizes the plugin base classes. Some of the classes are private, and are therefore not documented. You can use them, but there is no compatibility promise with later Qt versions.
Base Class |
Directory Name |
Qt Module |
Key Case Sensitivity |
---|---|---|---|
QAccessibleBridgePlugin |
accessiblebridge |
Case Sensitive |
|
QImageIOPlugin |
imageformats |
Case Sensitive |
|
QPictureFormatPlugin (obsolete) |
pictureformats |
Case Sensitive |
|
QAudioSystemPlugin |
audio |
Case Insensitive |
|
QDeclarativeVideoBackendFactoryInterface |
video/declarativevideobackend |
Case Insensitive |
|
QGstBufferPoolPlugin |
video/bufferpool |
Case Insensitive |
|
QMediaPlaylistIOPlugin |
playlistformats |
Case Insensitive |
|
QMediaResourcePolicyPlugin |
resourcepolicy |
Case Insensitive |
|
QMediaServiceProviderPlugin |
mediaservice |
Case Insensitive |
|
QSGVideoNodeFactoryPlugin |
video/videonode |
Case Insensitive |
|
QBearerEnginePlugin |
bearer |
Case Sensitive |
|
QPlatformInputContextPlugin |
platforminputcontexts |
Case Insensitive |
|
QPlatformIntegrationPlugin |
platforms |