Results 1 to 3 of 3

Thread: Problem with rotation of QGraphicsItem

  1. #1
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    46
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Problem with rotation of QGraphicsItem

    hi

    to all


    I have a problem related to rotation of QGraphicsItem.

    I m using the rotate() to rotate the QGraphicsItem ...

    but after rotating the bounding rect of QGraphicsItem is increasing ..

    Pls tell me the reason of this and pls tell me how can i protect it..

    Ashish
    Ashish Kumar Saryar

  2. #2
    Join Date
    Feb 2008
    Posts
    51
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem with rotation of QGraphicsItem

    Hi,

    It's true that if you will rotate the graphics item then it's bounding rectangle will change.
    It's a correct behavior. You will come to know if you will draw one rectangle inside your graphics item.

    When item is rotated, it changes it's bounding rect to accomdate the complete item inside it.

    Please try with polygon.

  3. #3
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with rotation of QGraphicsItem

    if the rectangle is rotated, a QRect (which is always parallel to the axes) needs to be larger to contain it. Just draw it on a piece of paper and you will see.

    There is no way around that.
    Perhaps you can use shape() instead?

Similar Threads

  1. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  2. Paint QGraphicsItem problem
    By dreamer in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2008, 18:18
  3. rotation of an animated QGraphicsItem
    By darksaga in forum Qt Programming
    Replies: 9
    Last Post: 9th September 2007, 08:11
  4. Rotation problem trying to draw a compass widget
    By yellowmat in forum Qt Programming
    Replies: 2
    Last Post: 18th February 2007, 19:03
  5. QGraphicsItem problem - how to save items info ??
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2006, 12:17

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.