summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp
blob: a6870b80264c1a4bb8e6d221f8cacc601ba52af4 (plain)
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]