David Beck | 3 Aug 2012 23:39
Picon
Picon
Favicon

QEvent.LeaveEditFocus

I'm getting the following error message when trying to use "LeaveEditFocus" in an event filter (Python 3.3, Mac OS 10.7, PyQt 4.9.2): 

Traceback (most recent call last):
  File "/Users/David/Documents/Python/Qt/QtFieldbook/QtFieldbook/QtFieldbook/runFieldbook.py", line 53, in eventFilter
    if event.type() == QtCore.QEvent.LeaveEditFocus:
AttributeError: type object 'QEvent' has no attribute 'LeaveEditFocus'

The filter runs fine with the other QEvents I've tried in the same conditional (e.g., FocusOut and Leave), but LeaveEditFocus would be better for my application.

David

<div>
<div>I'm getting the following error message when trying to use "LeaveEditFocus" in an event filter (Python 3.3, Mac OS 10.7, PyQt 4.9.2):&nbsp;</div>
<div><br></div>
<blockquote class="webkit-indent-blockquote">
<div><div>Traceback (most recent call last):</div></div>
<div><div>&nbsp; File "/Users/David/Documents/Python/Qt/QtFieldbook/QtFieldbook/QtFieldbook/runFieldbook.py", line 53, in eventFilter</div></div>
<div><div>&nbsp; &nbsp; if event.type() == QtCore.QEvent.LeaveEditFocus:</div></div>
<div><div>AttributeError: type object 'QEvent' has no attribute 'LeaveEditFocus'</div></div>
</blockquote>
<div><br></div>
<div>The filter runs fine with the other QEvents I've tried in the same conditional (e.g., FocusOut and Leave), but LeaveEditFocus would be better for my application.</div>
<div><br></div>
<div>David</div>
<div><br></div>
</div>
Phil Thompson | 4 Aug 2012 11:41

Re: QEvent.LeaveEditFocus

On Fri, 3 Aug 2012 15:39:01 -0600, David Beck <dbeck <at> ualberta.ca> wrote:
> I'm getting the following error message when trying to use
> "LeaveEditFocus" in an event filter (Python 3.3, Mac OS 10.7, PyQt
4.9.2): 
> 
> Traceback (most recent call last):
>   File
>  
"/Users/David/Documents/Python/Qt/QtFieldbook/QtFieldbook/QtFieldbook/runFieldbook.py",
>   line 53, in eventFilter
>     if event.type() == QtCore.QEvent.LeaveEditFocus:
> AttributeError: type object 'QEvent' has no attribute 'LeaveEditFocus'
> 
> The filter runs fine with the other QEvents I've tried in the same
> conditional (e.g., FocusOut and Leave), but LeaveEditFocus would be
better
> for my application.

As far as I can tell LeaveEditFocus is only supported on WinCE and
Symbian.

Phil

Gmane