[PyQt] Some QEvent::Type enum elements cannot be accessed by names

Phil Thompson phil at riverbankcomputing.com
Fri Feb 6 12:45:57 GMT 2015


On 06/02/2015 10:27 am, Yamamoto, Mitsuo wrote:
> Hello PyQt community,
> 
> I have recently noticed the matter of the subject. I don't know
> if it is a bug or an expected behaviour. Searching the keywords
> "ContentsRectChange" and "QEvent" on Gmane and The Mail Archive
> didn't give me a clue. If it is unexpected, I want to report it.
> 
> They are as follows:
> 
> PyQt GPL v5.4 for Python v3.4 (x64) with Python 3.4.2 on Windows 7;
>   QEvent.ContentsRectChange,
>   QEvent.EnterEditFocus,
>   QEvent.LeaveEditFocus,
>   QEvent.NonClientAreaMouseButtonDblClick,
>   QEvent.NonClientAreaMouseButtonPress,
>   QEvent.NonClientAreaMouseButtonRelease,
>   QEvent.NonClientAreaMouseMove,
>   QEvent.MacSizeChange,
>   QEvent.NativeGesture,
>   QEvent.ThreadChange
> 
> PyQt4-4.10.1-13.el7.x86_64 with python-2.7.5-16.el7.x86_64 on CentOS 7;
>   QEvent.ApplicationStateChange,
>   QEvent.ContentsRectChange,
>   QEvent.EnterEditFocus,
>   QEvent.Expose,
>   QEvent.FocusAboutToChange,
>   QEvent.InputMethodQuery,
>   QEvent.LeaveEditFocus,
>   QEvent.NonClientAreaMouseButtonDblClick,
>   QEvent.NonClientAreaMouseButtonPress,
>   QEvent.NonClientAreaMouseButtonRelease,
>   QEvent.NonClientAreaMouseMove,
>   QEvent.MacSizeChange,
>   QEvent.NativeGesture,
>   QEvent.OrientationChange,
>   QEvent.ReadOnlyChange,
>   QEvent.ScrollPrepare,
>   QEvent.Scroll,
>   QEvent.ThreadChange,
>   QEvent.TouchCancel
> 
> Trying to access enum values through these names raises AttributeError.
> Even so, values for those names seem encapsulated in QEvent objects
> when events occur and I can access them through QEvent::type(). I at
> least check that for ContentRectChange.

I've now gone through these. Some of them are internal, and some are 
only for embedded devices, but I've added those that are missing and 
should be there.

Thanks,
Phil


More information about the PyQt mailing list