[PyQt] Re: How to create a codec class? (new problem)

DDGG ddcatgg at gmail.com
Sat Dec 8 21:08:39 GMT 2007


Thanks for David Boddie's help! I forgot to call the base class's __init__()
method in my previous problem.

Then i have a new problem about this program:

from PyQt4 import QtCore

class QGb18030Codec(QtCore.QTextCodec):
    def __init__(self):
        QtCore.QTextCodec.__init__(self)

    def name(self):
        return "GB18030"

    def aliases(self):
        return []

    def mibEnum(self):
        return 114

    def convertToUnicode(self, chars, len):
        pass

    def convertFromUnicode(self, uc, len, state):
        pass

gb18030 = QGb18030Codec()

After i have run it, i got a notice message in my console window:
QTextCodec::~QTextCodec: Called by application
How to avoid this message?
Thanks again!


More information about the PyQt mailing list