PDA

View Full Version : Hover on mouse over while dragging



mooreaa
24th June 2008, 22:27
Hello,

Using the Diagram Scene example as a base, I'm trying to get some UI indication about the object the mouse is over.

In particular, when I draw a connector line from one object to another, I wanted to highlight the source and destination object (assuming that the targets are valid).

I gave the items a hover event, and they trigger fine normally, but when I am dragging a connector line form one object to another, the hover events don't trigger. Why is this?

I tried getting the object under the mouse and manually calling update to cause it to highlight and this works, but since there is no "hover exit" event, I don't have a good way of reupdating the object (removing the highlight) when the mouse leaves that object.

Any ideas?

aunlu
5th February 2010, 09:42
I am having the same problem. Have u found any solutions?

JuusoLeinonen
6th February 2010, 07:18
Hi
Theres hoverLeaveEvent and should be used in cases like this.
Should also check DiagramScenes mouseMoveEvent when drawing line...

axeljaeger
6th February 2010, 10:31
You can have pointer to the currently highlighted object. When you manualy update the object under the mouse, see whether you stored a pointer to the last highlighted update and unhighlight it first. Then highlight the new object and save it to that pointer. This way it is guarenteed that only one object is highlighted at one time.