Results 1 to 2 of 2

Thread: Moving parent item

  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Moving parent item

    QGraphicsItem::ItemIsMovable

    " If the item has children, all children are also moved. " says the documentation.

    I have a child item and parent item that are movable.
    When I move the parent, child item also moves. But when I move the child, parent doesn't move.

    I tried with reimplementing mouseMoveEvent of child item, it works, but when I select multiple items, it only moves the child (and its parent) under the mouse.

    How can this child item move its parent item?

    Is there any way to move the parent item ?

  2. #2
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Moving parent item

    QGraphicsItemGroup could be what you are looking for. It lets you create a group of items that can be treated as one.

  3. The following user says thank you to helloworld for this useful post:

    barisatamer (9th February 2011)

Similar Threads

  1. Replies: 2
    Last Post: 8th October 2010, 17:12
  2. How to orientate a moving item?
    By lengshuang in forum Qt Programming
    Replies: 2
    Last Post: 13th April 2009, 08:25
  3. How to get parent of selected item in TreeView?
    By RavenS in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2009, 13:27
  4. moving one graphical item over other item...
    By salmanmanekia in forum Qt Programming
    Replies: 36
    Last Post: 3rd July 2008, 07:59
  5. Moving an item in QGraphicsScene
    By prosass in forum Newbie
    Replies: 4
    Last Post: 28th March 2007, 14:21

Tags for this Thread

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.