PDA

View Full Version : mouseMoveEvent and leaveEvent Problems



Furkan
29th December 2010, 13:50
Hi. Using leaveEvent, I press and hold an item move it out of the list widget, still the leaveEvent isn't triggered, when I release the mouse it is triggered. Why is that? Should't it be triggered whenever mouse gets out of the widget? The same things happens with mouseMoveEvent it's not triggered if the mouse left button is held.
Please help!
Thanks in advance!

high_flyer
29th December 2010, 13:55
The same things happens with mouseMoveEvent it's not triggered if the mouse left button is held.
Is reading it here better then reading it in the documentation??

If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed.

This probably also effect the leaveEvent() and enterEvent() are behaving.
Try setting mouse tracking on, see if it helps.

Furkan
29th December 2010, 14:01
I did. But it didn't help.

high_flyer
29th December 2010, 14:06
Not even for mouseMove() events?

Furkan
29th December 2010, 14:07
mouseMove event works when I don't press and hold an item and move it around the widget.

high_flyer
29th December 2010, 14:12
then you are doing something else worng, but with out code its hard to tell.

Furkan
29th December 2010, 14:14
The widget.cpp >> http://paste.kde.org/1259/
the widget.h >> http://paste.kde.org/1260/
the main.cpp >> http://paste.kde.org/1246/

high_flyer
29th December 2010, 14:19
Hmm... in the code you posted I see nothing wrong.
I have used this in the past and never had trouble.
Maybe I am forgetting something...
Hopefully someone else might have an idea.

Furkan
29th December 2010, 14:24
Can you compile the code and see if it works for you?
It might be a bug may be. :D

high_flyer
29th December 2010, 14:25
Sorry, no, not at the moment, as I am at work.
Only in the evening.