Results 1 to 4 of 4

Thread: What are the methods to Handle for resizing QGraphicsItem

  1. #1
    Join Date
    Jan 2009
    Posts
    12
    Qt products
    Qt4

    Default What are the methods to Handle for resizing QGraphicsItem

    Hi,
    I want to resize a QGraphicsItem which r placed on to scene in runtime, I want the user to resize the Item after placing it on the scene. So what are methods or wat is the process for getting it.
    with regards,

  2. #2
    Join Date
    Dec 2008
    Location
    Czech
    Posts
    44
    Thanks
    2
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: What are the methods to Handle for resizing QGraphicsItem

    Hi,

    there is metod for scaling one item
    void QGraphicsItem::scale ( qreal sx, qreal sy )
    or if you want to scale whole scene then
    void QGraphicsView::scale ( qreal sx, qreal sy )

    radek.z

  3. #3
    Join Date
    Jan 2009
    Posts
    12
    Qt products
    Qt4

    Default Re: What are the methods to Handle for resizing QGraphicsItem

    But I want to resize it with drag event. i want to give user the option to resize. for example there is a line with default size then if user want to resize it then user need to click on line item so that item is ready for draging and user need to drag the ending or starting point to a particular position then the line should scale upto the mouse position.
    thanks for replying.

  4. #4
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: What are the methods to Handle for resizing QGraphicsItem

    U need to handle mouseMoveEvent() to resize ur item. In addition u need to write your own resizeItem() method which will be called from mouseMoveEvent().

    And you need to place all your logic of resizing an item in the resizeItem() method.

    Regards,
    ~Sanjay

Similar Threads

  1. Problems with QGraphicsItem and Overiding methods
    By Terabyte in forum Qt Programming
    Replies: 10
    Last Post: 27th December 2008, 17:45

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.