In python (and PyQt), the way to create an enumeration is as follows:
class MyEnum(object): One = 1 Two = 2 Three = 3
If you need more functionality than this, please give more details on what you are trying to do.
EDIT
Looking at the documentation for QAbstractSocket.stateChanged I see that this refers to "Creating Custom Qt Types". I am not aware of the need to register metatypes in PyQt4, so all you need to do to use this signal is connect it to the appropriate handler:
class Socket(QTcpSocket): def __init__(self): QTcpSocket.__init__(self) self.stateChanged.connect(self.handleStateChanged) def handleStateChanged(self, state): print state
source share