Results 1 to 4 of 4

Thread: Hover on mouse over while dragging

  1. #1

    Default Hover on mouse over while dragging

    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?

  2. #2
    Join Date
    Feb 2010
    Posts
    1
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Hover on mouse over while dragging

    I am having the same problem. Have u found any solutions?

  3. #3
    Join Date
    Feb 2010
    Location
    Finland
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: Hover on mouse over while dragging

    Hi
    Theres hoverLeaveEvent and should be used in cases like this.
    Should also check DiagramScenes mouseMoveEvent when drawing line...

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Hover on mouse over while dragging

    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.
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Dragging mouse selection in QTableWidget
    By yartov in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2008, 16:03
  2. QTextBrowser and Hover
    By yogeshgokul in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2008, 12:18
  3. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 07:13
  4. Replies: 2
    Last Post: 24th July 2006, 19:36
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 20:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.