[PyKDE] SIP v4.2rc2 Bug???

Phil Thompson phil at riverbankcomputing.co.uk
Mon Feb 14 10:34:05 GMT 2005

> Hi,
> I'm not sure if this is a bug, but it is at least a difference in
> behavior between sip-4.1.1 and the 4.2rc2.
> With PyQt compiled against sip-4.1.1, the function
> QMainWindow.moveToolBar(dockWindow, qDock) is happy with an integer as
> the 2nd argument.  This works out well for restoring a dock, because
> that's what the QMainWindow.getLocation(dockWindow) command returns.
> But with sip-4.2rc2, it throws a TypeError: argument 2 of
> QMainWindow.moveDockWindow() has an invalid type.  But it still works if
> Qt.DockTop is given as the second argument.  Which is strange, because
> the Python interpreter says Qt.DockTop = 2.
> I could work around this if it is intended functionality, but I'd rather
> not...

It's intended functionality. As of SIP 4.2 enums have their own distinct
type (which is a sub-type of integer) as they do in C++. If you have an
integer then you need to cast it by calling the type object with the
integer as it's argument.


More information about the PyQt mailing list