Results 1 to 3 of 3

Thread: mouseMoveEvent receiving zero's

  1. #1
    Join Date
    Sep 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default mouseMoveEvent receiving zero's

    Hi,

    I am very early on the learning curve with Qt, andhave run into an oddity with mouse event handling.

    I have constructed a class based on QGLWidget. The class includes 3 mouse event handlers
    - mousePressEvent
    - mouseDoubleClickEvent
    - mouseMoveEvent

    I can see that all of these functions are being called upon the given events, the PressEvent and DoubleClickEvent work fine, but the event data received by the mouseMoveEvent seems to be all zeros e.g. event->x() event->y() and event->button() all return zero.

    Do I have to do anything different to get 'real' event data into the mouseMoveEvent?

    Thanks ...

  2. #2
    Join Date
    Sep 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: mouseMoveEvent receiving zero's

    ... first post was slightly hasty ...

    the mouseMoveEvent is receiving valid positions, but button() always returns 0, is this expected?

  3. #3
    Join Date
    Sep 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: mouseMoveEvent receiving zero's


    ... so now I know to read the documentation (which I am impressed with), and call buttons() to get the current button state.

    Thanks for reading!

Similar Threads

  1. Problem in MouseMoveEvent
    By aamer4yu in forum Qt Programming
    Replies: 18
    Last Post: 3rd December 2015, 11:20
  2. mouseMoveEvent in QGraphicsItem
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 6th July 2009, 13:41

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.