Results 1 to 6 of 6

Thread: QWMatrix::mapRect

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    22
    Thanks
    1

    Default QWMatrix::mapRect

    Hello all,

    I am fighting with a problem regarding mapping a rectangle which is not of

    QRect type. I want to rotate the rectangle 90 degree counterclockwise and

    I just did it as follow but the result is not what I want.Instead the rectangle

    gets larger in size. Can someone give me suggestions how to solve this problem?

    Qt Code:
    1. QWMatrix matrixWorld;
    2. QRect newRect;
    3. double rotateDegree = 90.0;
    4.  
    5. newRect.setRect(myRect.Left(), myRect.Top(), myRect.Width(), myRect.Height());
    6. matrixWorld.rotate(rotateDegree);
    7. newRect = matrixWorld.mapRect(newRect);
    8. myRect.Rect(newRect.left(), newRect.top(), newRect.width(), newRect.height());
    To copy to clipboard, switch view to plain text mode 
    Last edited by Pharell; 28th August 2008 at 14:38.

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
  •  
Qt is a trademark of The Qt Company.