Results 1 to 3 of 3

Thread: resize graphicsitem

  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 resize graphicsitem

    how do you resize (larger or smaller) a graphicsitem in a view.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: resize graphicsitem

    Use:
    Qt Code:
    1. void QGraphicsItem::scale ( qreal sx, qreal sy )
    To copy to clipboard, switch view to plain text mode 
    Scales the current item transformation by (sx, sy) around its origin. To scale from an arbitrary point (x, y), you need to combine translation and scaling with setTransform().

    Example:
    Qt Code:
    1. // Scale an item by 3x2 from its origin
    2. item->scale(3, 2);
    3. // Scale an item by 3x2 from (x, y)
    4. item->setTransform(QTransform().translate(x, y).scale(3, 2).translate(-x, -y));
    To copy to clipboard, switch view to plain text mode 

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

    rogerholmes (18th August 2009)

  4. #3
    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 Re: resize graphicsitem

    Thank You , I found it to tonite.

Similar Threads

  1. Replies: 1
    Last Post: 10th August 2008, 18:55
  2. Replies: 2
    Last Post: 22nd January 2008, 16:10
  3. QGraphicsScene / QGraphicsView speed after resize
    By themolecule in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2007, 23:46
  4. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

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.