Results 1 to 2 of 2

Thread: reimplementing mouseMoveEvent of QGraphicsItem

  1. #1
    Join Date
    May 2010
    Location
    Germany
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default reimplementing mouseMoveEvent of QGraphicsItem

    Hi there,

    I have a question to QGraphicsSceneMouseEvents. I have several QGraphicsItems and I want to detect whether the items are colliding and if so move them in a certain way, so I reimplemented QGraphicsItem's mouseMoveEvent(QGraphicsSceneMouseEvent *event) to move the item in my own function. But it seems that the basic move implementation of QGraphicsItem::mouseMoveEvent() is still called despite I don't call it in my reimplemented moveEvent.
    When I comment my own move function out the item is still moved. So how can I explicitly block the execution of the standard implementation? Or do I have to change something in my graphicsScene? I have my own QGraphicsScene but I haven't reimplemented the mouseMoveEvent() of the graphicsScene, maybe I have to do that, can you provide me any hints?
    If I forgot any important info please let me know.

    Thanks a lot in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: reimplementing mouseMoveEvent of QGraphicsItem

    You don't move a item with mouseMoveEvent()! It is mainly done in setPos().

Similar Threads

  1. Replies: 5
    Last Post: 31st December 2010, 12:49
  2. Reimplementing sceneEvent()
    By netaques in forum Newbie
    Replies: 0
    Last Post: 18th October 2010, 12:32
  3. problem reimplementing mouseMoveEvent
    By jhowland in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2010, 21:18
  4. mouseMoveEvent in QGraphicsItem
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 6th July 2009, 14:41
  5. Replies: 6
    Last Post: 1st May 2007, 00:59

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.