[PyKDE] QWMatrix bugs -- actually a documentation bug

Mark Summerfield mark at trolltech.com
Wed Sep 3 21:57:01 BST 2003


On Tuesday 02 September 2003 22:16, myrkraverk at users.sourceforge.net wrote:
> Hi again,
>
> Sorry to bother you all with this, I found the bug, it's in the
> example on the weg page, not a Qt bug, but a documentation bug.  I
> hope Trolltech will fix this, right now should do it ;)
>
> myrkraverk at users.sourceforge.net writes:
>  > Your right -- and wrong.  There is a * operator in the Qt class, it is
>  > just not documented very well, the only reference to it in the docs is
>  > in the following example from qwmatrix.html:
>  >
>  >   double a    = pi/180 * 25;         // convert 25 to radians
>  >   double sina = sin(a);
>  >   double cosa = cos(a);
>  >   QWMatrix m1(0, 0, 0, 0, 10, -20);  // translation matrix
>  >   QWMatrix m2( cosa, sina,           // rotation matrix
>  >               -sina, cosa, 0, 0 );
>  >   QWMatrix m3(1.2, 0, 0, 0.7, 0, 0); // scaling matrix
>  >   QWMatrix m;
>  >   m = m3 * m2 * m1;                  // combine all transformations
>  >
>  > Unfortunately, the * doesn't seem to work, after running the above
>  > code (with enaugh mods to make it compile), m is the zero matrix ;(
>
> In the above code it should be QWMatrix m1( 1, 0, 0, 1, 10, -20 ) and
> not zeros for all four values.

You're quite right. The docs have been updated.

Thanks for pointing this out.

-- 
Mark.




More information about the PyQt mailing list