1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
//! [0] QList<QByteArray> MyCodecPlugin::names() const { return QList<QByteArray> << "IBM01140" << "hp15-tw"; } QTextCodec *MyCodecPlugin::createForName(const QByteArray &name) { if (name == "IBM01140") { return new Ibm01140Codec; } else if (name == "hp15-tw") { return new Hp15TwCodec; } return 0; } //! [0]