Results 1 to 5 of 5

Thread: Normal mouseMoveEvent Behavior?

  1. #1
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Normal mouseMoveEvent Behavior?

    Hi,

    I'm having a problem with QWidget mouseMoveEvent. While moving the mouse if a button is pressed, the handler is not called any more even after the button is released. Any idea?

    Thanks.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Normal mouseMoveEvent Behavior?

    Did you call QWidget::setMouseTracking() with a "true" argument?

  3. #3
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Normal mouseMoveEvent Behavior?

    It has nothing to do with setMouseTracking, called or not the mouseMoveEvent gets called on mouse move no problem, but when I press a mouse button while moving it stops.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Normal mouseMoveEvent Behavior?

    Then something else is intercepting and handling the mouse move event before it can get to you. If you are doing this in a QGraphicsView, then it could be that the view is intercepting them and turning them into scene events:

    You can interact with the items on the scene by using the mouse and keyboard. QGraphicsView translates the mouse and key events into scene events, (events that inherit QGraphicsSceneEvent,), and forward them to the visualized scene. In the end, it's the individual item that handles the events and reacts to them. For example, if you click on a selectable item, the item will typically let the scene know that it has been selected, and it will also redraw itself to display a selection rectangle. Similiarly, if you click and drag the mouse to move a movable item, it's the item that handles the mouse moves and moves itself. Item interaction is enabled by default, and you can toggle it by calling setInteractive().

  5. #5
    Join Date
    Apr 2010
    Posts
    152
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Normal mouseMoveEvent Behavior?

    Thanks you give me some hints...another widget receives the mouse events and handles them at the same time...I will have to filter out or stop the other widget event handling until the first widget is done with move/drag.
    Last edited by qtoptus; 28th February 2015 at 18:00.

Similar Threads

  1. Is that normal about QListView ?
    By Alundra in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2015, 09:13
  2. How to block the normal buttons of a QWidget
    By Momergil in forum Qt Programming
    Replies: 3
    Last Post: 4th January 2012, 12:32
  3. Style sheets bug? Or normal behavior?
    By Syntho in forum Qt Programming
    Replies: 0
    Last Post: 7th June 2010, 09:16
  4. Start application minimized or normal
    By matze in forum Qt Programming
    Replies: 3
    Last Post: 12th January 2010, 14:57
  5. Difference between normal socket and QTcpSocket
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 16th June 2007, 04:38

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.