Results 1 to 7 of 7

Thread: Too few MouseMoveEvents

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

    Default Too few MouseMoveEvents

    Hi gals + guys!

    I set mousetracking=true to the viewport of my QGraphicsview.

    I am then watching over MouseMoveEvents in my MainWindow class.

    Why is it that I only recieve MouseMoveEvents every 5 seconds or so even when I'm scrolling around the panel like stupid?

    To make it clear: I AM recieving events, just not enough.

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Too few MouseMoveEvents

    Why not setting mouse tracking directly to your QGraphicsView?
    has your viewport something special?

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

    Default Re: Too few MouseMoveEvents

    No it does not. But by reading thru the NET it seemed like the 'way to do it'.

    Anyways setting mousetracking=true directly on the QGraphicsView achieves the same effect. Rare move events.


    Edit: I think I'm just not getting any events when the cursor is in the graphicsScene which is inside the graphicsview...... Only right on the crack when leaving the whole window.

    I just subclassed QGraphicsScene and implemented mousemoveevent but it isnt getting called... strange!
    Last edited by BastiWF; 24th September 2009 at 15:40.

  4. #4
    Join Date
    Jul 2009
    Posts
    42
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Too few MouseMoveEvents

    Hello, I was experiencing the same(similar) problem.

    In my case I have a Widget subclassed from QFrame. Since I want to be able to re-size the Widget, i decided to handle the mouse movements in order to set the proper cursors when hovering the edges, but at certain mouse speeds it just kept the re-size cursors even though the mouse was moving inside the widget.

    That's when i noticed that you must enable mouse Tracking for all relevant Widgets, so i guess in your case you also have to enable the mouse tracking for your graphics elements.

    Greets and hope this helps.

    Eric

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

    Default Re: Too few MouseMoveEvents

    Do you get all the needed events if you hold the mouse button pressed?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Aug 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Too few MouseMoveEvents

    For receiving frequent MouseMove events is it necessary that mainwindow should have its centralWidget should be of type QGraphicsView ?. In my application the central Widget is if type QWidget, I am unable to receive frequent mouseMoveEvents in mainwindow even after settings mouse tracking.

    Can we not get mouseEvents without making use of QGraphicsView class ?
    Last edited by srinirao; 2nd November 2009 at 10:39. Reason: additional question

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

    Default Re: Too few MouseMoveEvents

    Quote Originally Posted by srinirao View Post
    Can we not get mouseEvents without making use of QGraphicsView class ?
    Sure we can.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. extra mouseMoveEvents causing jittering in QGraphicsView
    By supertwang in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2009, 10:14

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
  •  
Qt is a trademark of The Qt Company.