Results 1 to 2 of 2

Thread: Update scene after moving QGraphicsItem

  1. #1
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Update scene after moving QGraphicsItem

    I am moving a QGraphicsItem in a scene using item->setPos(), this works but, how do you update the scene to register the new position .

    i am using a function:

    Qt Code:
    1. if(picItem->boundingRect().contains(pos))
    2. {
    3. QApplication::beep();
    4. }
    To copy to clipboard, switch view to plain text mode 

    in a mouseover to show where the scene has the item registered.

    now the scene beeps at the original position even though the item is visible at a new position, i need to tell the scene the item has moved so it will beep at the new position.

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Update scene after moving QGraphicsItem

    did u reimplement itemChanged() in scene

    QVariant QGraphicsItem::itemChange ( GraphicsItemChange change, const QVariant & value ) [virtual protected]
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. Moving of QGraphicsItem
    By Erlendhg in forum Qt Programming
    Replies: 17
    Last Post: 5th November 2013, 15:04
  2. QGraphicsItem .. Scene .. View question?
    By DirtyBrush in forum Qt Programming
    Replies: 21
    Last Post: 19th October 2010, 09:12
  3. How to update scene after removing items
    By nileshsince1980 in forum Qt Programming
    Replies: 4
    Last Post: 20th September 2007, 09:56
  4. How to find out scene update time
    By nileshsince1980 in forum Qt Programming
    Replies: 5
    Last Post: 20th September 2007, 09:46
  5. Moving the (0.0) point on the scene
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 6th September 2007, 15:34

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.