[PyKDE] QtCore.Qt and QtGui.Qt

Phil Thompson phil at riverbankcomputing.co.uk
Thu Mar 2 14:58:18 GMT 2006


On Thursday 02 March 2006 2:45 pm, Sundance wrote:
> On Thu, Mar 02, 2006 at 02:01:35PM +0000, Phil Thompson wrote:
> > As I said in another reply - I don't see the difference. Whether it's
> > PyQt4.Qt rather than PyQt4.QtCore.Qt, the magic still has to happen
> > when you import QtGui.
>
> Well, I think the idea is that the Qt namespace would contain everything
> it needs to, from all the PyQt modules, right from the start. I.e. even
> if you only import QtCore, the Qt namespace would contain
> WhiteSpaceMode and all. Always the same, no changes no matter what you
> import and don't import. But as said, I understand that this may not be
> easily feasible within the SIP/PyQt architecture (because, mind, I
> don't know HOW the namespace is implemented there to start with. There
> are a lot of people here who Know Their Shit like there's no tomorrow,
> but I'm not one of them).

What you describe can be implemented, but it means that the Qt module must be 
linked against the Core and Gui Qt libraries. This is an absolute no as far 
as I am concerned - you must be able to write a non-GUI application without 
having to drag in the QtGui library.

The magic is needed to avoid this dependency.

Phil




More information about the PyQt mailing list