[PyKDE] QWidget.winId() not working?

Phil Thompson phil at river-bank.demon.co.uk
Wed May 1 11:32:00 BST 2002


"Smith, Dave" wrote:
> 
> Looks like QWidget.winId() is broken in at least PyQt 3.1.  When I try to use it I get:
> 
> Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from qt import *
> >>> qApp = QApplication([])
> >>> button = QPushButton(None)
> >>> button.winId()
> <PyCObject object at 0x007E9DA0>
> >>>
> 
> According to the PyQt documentation it is implemented.
> 
> I was expecting an integer value to be returned, in Qt, WId
> is declared as 'typedef int WId;' in qwindowdefs.h.

I think you are mis-reading qwindowdefs.h. It's an int like type on
everything except Windows.

Phil




More information about the PyQt mailing list