[review] [PyKDE] mouse-over/motion signal?

Jim Bublitz jbublitz at nwinternet.com
Wed Sep 22 01:50:49 BST 2004


On Tuesday 21 September 2004 17:23, Alfred Young wrote:
> I'm trying to create a selectable list of custom widgets that can be
> 'clicked-and-dragged' to select all at once--
>
> For those familiar with perl, this would be equivalent to a <motion>
> bind on the mouse...
>
> However, I haven't been able to find a certain signal or method to
> reproduce the same kind of functionality.
>
> Has anyone out there found a similar method to this?

All QWidget descendants inherit QWidget.enterEvent and QWidget.leaveEvent 
which can be overloaded. You'd need to subclass the widget you're interested 
and overload those two methods to either do what you want or emit a signal 
that can be connected to a slot. 

See the Qt docs for QWidget. You can also track mouse movement if that's 
needed (mouseMoveEvent, setMouseTracking).

You can also create your own signals (PYSIGNAL) that you can connect to.

Jim




More information about the PyQt mailing list