Results 1 to 4 of 4

Thread: About the mouseMoveEvent()

  1. #1

    Default About the mouseMoveEvent()

    In the QWidget and QGLWidget,the default policy is that, the widget only receives mouse move events when at least one mouse button is pressed while the mouse is being moved.
    but in the QGraphicsScene and QGraphicsView ,the Scene or View receives mouse move events even if no buttons are pressed.i have use the setMouseTracking(false) in the QGraphicsView class,but it doesn't work. Why ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: About the mouseMoveEvent()

    Quote Originally Posted by bingoking View Post
    I have use the setMouseTracking(false) in the QGraphicsView class,but it doesn't work. Why ?
    You want to disable move events for graphicsview? Probably some items have hover mouse events turned on and the view enables mouse tracking to be able to send them.

  3. #3

    Default Re: About the mouseMoveEvent()

    Quote Originally Posted by wysota View Post
    You want to disable move events for graphicsview? Probably some items have hover mouse events turned on and the view enables mouse tracking to be able to send them.

    I want the scene or view to receive mouse move events only when at least one mouse button is pressed while the mouse is being moved.How to do?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: About the mouseMoveEvent()

    Disabling hover events for all items and then disabling mouse tracking for the view (after the scene is already setup) would be my first try. Actually I'm surprised mouse tracking is turned on by default...

Similar Threads

  1. Problem in MouseMoveEvent
    By aamer4yu in forum Qt Programming
    Replies: 18
    Last Post: 3rd December 2015, 11:20
  2. QTableWidget mouseMoveEvent
    By mbjerkne in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2013, 20:53
  3. mouseMoveEvent contains wrong position?
    By draftpunk in forum Qt Programming
    Replies: 10
    Last Post: 12th September 2008, 01:59
  4. Changing QPushButton text colour with mouseMoveEvent
    By Misenko in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2008, 16:53
  5. EventFilter and MouseMoveEvent
    By mickey in forum Qt Programming
    Replies: 10
    Last Post: 28th January 2006, 09:53

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.