[PyKDE] QtCore.Qt and QtGui.Qt

Phil Thompson phil at riverbankcomputing.co.uk
Thu Mar 2 14:04:19 GMT 2006

On Thursday 02 March 2006 1:20 pm, Giovanni Bajo wrote:
> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> >> ---------------------------
> >> from PyQt4.QtCore import *
> >> from PyQt4.QtGui import *
> >>
> >> dir(Qt)
> >> ---------------------------
> >>
> >> won't show the full Qt namespace, thus making PyQt4 unusable without the
> >> annoying QtCore/QtGui prefix in front of everything?
> >
> > Yes - I hadn't considered that - mainly because I don't adopt such a poor
> > programming practice ;) Seriously, I don't have much sympathy for people
> > using a feature that makes it easy to shoot yourself in the foot,
> So you're one of those programmers who writes a Python module which uses
> Qt, and defines a class called QWidget or qSIGNAL in it, which has nothing
> to do with Qt? Because really, that's the only reason why you should suffer
> from writing **and reading** all those boring and obfuscating QtCore and
> QtGui prefixes everywhere. I don't need to read QtGui to know what a
> QComboBox is, while I strongly need "re" to know what "compile" means.

Remember, SIP (which is what we are talking about) is a generic tool. It 
doesn't behave differently just because it's building PyQt.

...and you've obviously never programmed Qtopia. Trolltech adhere to the Q 
prefix, except in the places that they don't.


More information about the PyQt mailing list