[PyKDE] QApplication.notify gets QObject receiver args

Phil Thompson phil at river-bank.demon.co.uk
Sat Apr 27 16:06:01 BST 2002


alh at jenkon.com wrote:
> 
> Howdy,
> 
> I've encountered some mysterious behavior under PyQt.
> While watching receiver/event args in a qt.QApplication.notify
> override, the first time a window is created/opened, the receiver arg
> (for focus events on the new window) is an instance of qt.QLineEdit.
> The second time the same type of window is created/opened, the receiver arg
> is a qt.QObject instance (instead of the expected qt.QLineEdit).
> 
> Environment is Win2000, Python 2.1.3, Qt 3.0.3, PyQt 3.1.
> 
> For example, run the code below (which opens a window w/ a
> "Click" button).
> 
> -- Click the "Click" button, opening a second window with two line-edit controls.
> -- Tab twice, alternating focus between the two line-edits; notice that the receiver of the FocusIn
> events are instances of qt.QLineEdit.
> -- Click the "Click" button, closing the second window.
> -- Click the "Click" button to create a new instance of the second window.
> -- Tab twice again; notice that this time, the receiver of the FocusIn events are instances of
> qt.QObject!

This appears to function correctly in 3.2rc4.

Phil




More information about the PyQt mailing list