Results 1 to 3 of 3

Thread: Inhibiting child scaling from parent

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Inhibiting child scaling from parent

    I'm working on a simple, mspaint-style graphics editor. The 'big' thing I'm trying to add is selection boxes to individual items, not just the current thing being edited. I've created a SelectionBox class that subclasses QGraphicsAbstractShapeItem, I've also abstracted the various QGraphicsXItem classes. When I create a graphics item I also add a SelectionBox as a child of the item. Everything works correctly until I apply a scaling transformation to the graphics item which also causes the child SelectionBox to scale which I don't want. Is there a way to prevent the transformation from being applied to a child item?

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Inhibiting child scaling from parent

    Try setting QGraphicsItem::ItemIgnoresTransformations on the item.

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

    sfpiano (11th September 2010)

  4. #3
    Join Date
    Sep 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Inhibiting child scaling from parent

    Thanks, that's what I was looking for.

Similar Threads

  1. Parent/child transformations
    By jano_alex_es in forum Newbie
    Replies: 4
    Last Post: 5th November 2009, 10:13
  2. Parent-child realtionship
    By AviMittal in forum Qt Programming
    Replies: 3
    Last Post: 25th June 2009, 15:44
  3. parent/child callback
    By mhoover in forum General Programming
    Replies: 2
    Last Post: 24th June 2009, 23:50
  4. Child-Parent Widget??
    By anupamgee in forum Qt Programming
    Replies: 1
    Last Post: 11th May 2009, 13:17
  5. Parent Child for window
    By febil in forum Qt Programming
    Replies: 6
    Last Post: 1st April 2009, 05:00

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.