[PyQt] event object type for TabletEnterProximity

Phil Thompson phil at riverbankcomputing.com
Mon Nov 23 17:41:44 GMT 2009


On Mon, 23 Nov 2009 09:54:43 -0700 (MST), buddy+pyqt at nmt.edu wrote:
> When I look for the TabletEnterProximity in my application the class for
> the event
> is a regular QEvent rather than a QTabletEvent as is indicated in the
> documentation.
>  I want to get out the pointer type for the event so that I know when the
>  user
> changes pointers (say from the stylus to the eraser side).  This is the
> code I was
> using in my class inherited from QApplication:
> 
>   def event(self,event):
>     if event.type==QEvent.TabletEnterProximity:
>       checkForNewPointerType(event.pointerType())
>     return QApplication.event(self,event)
> 
> It produced an exception because pointerType is not a method for a base
> QEvent object.
> 
> Is there something I'm possibly forgetting? and if this is a bug then is
> there
> another way to do what I want?  I want the change to be picked up before
> the user
> presses down with the tablet.  Is there something similar to
> QWidget.setMouseTracking so I can get tablet events when no buttons are
> pressed
> down?

Support for some event sub-classes was missing - fixed in tonight's
snapshot.

Thanks,
Phil


More information about the PyQt mailing list