Qt 6: Missing QMouseEvent methods

Phil Thompson phil at riverbankcomputing.com
Fri Aug 27 12:36:05 BST 2021


On 27/08/2021 12:11, Florian Bruhin wrote:
> Hi,
> 
> It looks like QMouseEvent is missing various methods:
> https://doc.qt.io/qt-6/qmouseevent.html#public-functions
> 
> vs.
> 
>     >>> from PyQt6.QtGui import QMouseEvent
>     >>> dir(QMouseEvent)
>     [
>         Type,
>         # [dunder methods...]
>         'accept',
>         'allPointsAccepted',
>         'button',
>         'buttons',
>         'clone',
>         'device',
>         'deviceType',
>         'exclusivePointGrabber',
>         'globalPosition',
>         'ignore',
>         'isAccepted',
>         'isBeginEvent',
>         'isEndEvent',
>         'isInputEvent',
>         'isPointerEvent',
>         'isSinglePointEvent',
>         'isUpdateEvent',
>         'modifiers',
>         'point',
>         'pointById',
>         'pointCount',
>         'pointerType',
>         'pointingDevice',
>         'points',
>         'position',
>         'registerEventType',
>         'scenePosition',
>         'setAccepted',
>         'setExclusivePointGrabber',
>         'spontaneous',
>         'timestamp',
>         'type'
>     ]
> 
> i.e. all methods of QMouseEvent seem to be missing, only the ones
> inherited from QSinglePointEvent/QPointerEvent/QInputEvent/QEvent are
> present.

...which are the ones you should use.

PyQt6 doesn't wrap anything that was marked as deprecated in Qt v6.0.0.

pos() was missing though.

Phil


More information about the PyQt mailing list