March 27, 2011

xtingray xtingray
Lab Rat
90 posts

setScale(qreal) vs scale(qreal, qreal)

 

Hi,
Looking around the Internet, I found this link:
http://kunalmaemo.blogspot.com/2010/07/rotation-and-mirroring-qgraphicsitem-in.html

Something interesting about it was to find this instruction:

  1. graphicsItem->scale(-1,1)

I was looking for the method scale(qreal, qreal) in the QGraphicsItem documentation:
http://doc.qt.nokia.com/latest/qgraphicsitem-members.html

And there’s no trace about it. The funny thing is that I tested that method from my
source code using Qt 4.7 and it really works. Is this a ghost method or I’m missing
something?

Anyway, unfortunately for me it is not exactly what I am looking for.
My question is this:

I need the same result of the method setScale(qreal) but with the option of scaling
X and Y axes with different values.
Is there a way to implement something like setScale(qreal, qreal) ?

Thanks for any clue!

 Signature 

—-
Gustav Gonzalez
Development Leader
.(JavaScript must be enabled to view this email address)

Tupi: Magia 2D
http://www.maefloresta.com
—-

1 reply

March 27, 2011

Andre Andre
Robot Herder
6420 posts

You might want to check out QGraphicsItem::setTransform(). That method allows you to set a QTransform, which allows you to setup basically any 2D transformation you might need.

 
  ‹‹ :: error: collect2: ld returned 1 exit status      Questions about QMdiSubWindow title bar ››

You must log in to post a reply. Not a member yet? Register here!