Results 1 to 3 of 3

Thread: Mouse movement problem in QGraphicsView

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Mouse movement problem in QGraphicsView

    Hi,

    I have a QGraphicsItem which is working as the new mouse icon when the graphics view has mouse tracking on itself. I did this operation by something like the following

    CursorItem* myQGraphicsItemAsCursor = new CursorItem()

    QGraphicsView::mouseMoveEvent( ... pEvent)
    {
    ...
    myQGraphicsItemAsCursor->move(pEvent->x(), pEvent->y())
    ...
    }

    CursorItem::move( int x, int y)
    {
    QGraphicsItem::setPos(x, y);
    ...
    }


    The problem is it really seems that mouse suffers from something when it hovers on the view. It couldn't catch all mouse moves. What could be the possible problems?


    Thanks in advance

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mouse movement problem in QGraphicsView

    Might be improper translation of view coordinates to scene coordinate. Since in view, you get pos based on view coordinates, and when you setPos on item, it sets pos on scene cordinates...

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Mouse movement problem in QGraphicsView

    Hi,

    I mapped the view coordinates to scene's and pass them into the move(...) method but it didn't worked

Similar Threads

  1. problem with mouse release on the border, help me!
    By dungsivn in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2007, 08:16
  2. Replies: 3
    Last Post: 7th August 2006, 17:24
  3. Replies: 2
    Last Post: 24th July 2006, 18:36
  4. setCanvas blocks mouse movement on QtCanvasView
    By YuriyRusinov in forum Qt Programming
    Replies: 8
    Last Post: 20th April 2006, 07:38
  5. Sorry another problem. Mouse Buttons.
    By Zephro in forum Qt Programming
    Replies: 14
    Last Post: 24th February 2006, 16:08

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.