
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQTextCodecPlugin class provides an abstract base for customQTextCodec plugins.More...
| Header: | #include <QTextCodecPlugin> |
| Inherits: | QObject |
Note: All functions in this class arereentrant.
| QTextCodecPlugin(QObject * parent = 0) | |
| ~QTextCodecPlugin() | |
| virtual QList<QByteArray> | aliases() const = 0 |
| virtual QTextCodec * | createForMib(int mib) = 0 |
| virtual QTextCodec * | createForName(const QByteArray & name) = 0 |
| virtual QList<int> | mibEnums() const = 0 |
| virtual QList<QByteArray> | names() const = 0 |
TheQTextCodecPlugin class provides an abstract base for customQTextCodec plugins.
The text codec plugin is a simple plugin interface that makes it easy to create custom text codecs that can be loaded dynamically into applications.
Writing a text codec plugin is achieved by subclassing this base class, reimplementing the pure virtual functionsnames(),aliases(),createForName(),mibEnums() andcreateForMib(), and exporting the class with theQ_EXPORT_PLUGIN2() macro. SeeHow to Create Qt Plugins for details.
See theIANA character-sets encoding file for more information on mime names and mib enums.
Constructs a text codec plugin with the givenparent. This is invoked automatically by theQ_EXPORT_PLUGIN2() macro.
Destroys the text codec plugin.
You never have to call this explicitly. Qt destroys a plugin automatically when it is no longer used.
[pure virtual]QList<QByteArray> QTextCodecPlugin::aliases() constReturns the list of aliases supported by this plugin.
[pure virtual]QTextCodec * QTextCodecPlugin::createForMib(int mib)Creates aQTextCodec object for the mib enummib.
Seethe IANA character-sets encoding file for more information.
See alsomibEnums().
[pure virtual]QTextCodec * QTextCodecPlugin::createForName(constQByteArray & name)Creates aQTextCodec object for the codec calledname. Thename must come from the list of encodings returned bynames(). Encoding names are case sensitive.
Example:
QList<QByteArray> MyCodecPlugin::names()const{returnQList<QByteArray><<"IBM01140"<<"hp15-tw";}QTextCodec*MyCodecPlugin::createForName(constQByteArray&name){if (name=="IBM01140") {returnnew Ibm01140Codec; }elseif (name=="hp15-tw") {returnnew Hp15TwCodec; }return0;}
See alsonames().
[pure virtual]QList<int> QTextCodecPlugin::mibEnums() constReturns the list of mib enums supported by this plugin.
See alsocreateForMib().
[pure virtual]QList<QByteArray> QTextCodecPlugin::names() constReturns the list of MIME names supported by this plugin.
If a codec has several names, the extra names are returned byaliases().
See alsocreateForName() andaliases().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.