[PyKDE] Auto-connecting Slots

Giovanni Bajo rasky at develer.com
Sun Jan 29 02:18:35 GMT 2006


Gerard Vermeulen <gerard.vermeulen at grenoble.cnrs.fr> wrote:

> from PyQt4.QtCore import *
> from PyQt4.QtCore import signature as pyqtSignature
> import signature from signature

Not a solution, you still have "signature" in the global namespace.

> I understand that you like to take an unrecommended shortcut and
> pollute the global namespace (Q-, q-prefix or not), but it is no
> reason to make life harder for people who don't.

The Q prefix *is* a namespace. It's the way namespaces have always worked way
before we were using languages with explicit syntax for namespaces, and the way
it works in C++ for Qt. Then, if you want to double your namespace by prefixing
an unneeded QtCore in front of it, and making your source code harder and
slower to read, that's your choice. The fact that in Python modules are
namespaces doesn't mean that one has to blindly use them as namespaces even
when not necessary. Again, I have *never* seen Python code using PyOpenGL with
the module as a namespace (GL.glBegin), so I just can't see why it should be
any different for Qt.

Giovanni Bajo




More information about the PyQt mailing list