[EMAIL PROTECTED] schrieb:
Hello,

I'm relatively new to python, but not Qt as such.  When I was going
through the Qt tutorial, the 14 steps, I came across some
shortcommings for QWMatrix, and not all of them documented on the web
page.

Before I go any further, I'm going to state that my version of python
is 2.3, PyQt is 3.8 and Qt is 3.2.1.

It is not possible to use the new mapRect() method of QWMatrix, but
map() works for QRect, but is obsolete, this should at least be
documented.
That's right. This should be changed. Small patch for the sip files
included.

Other shortcommings of QWMatrix is the lack of the * operator, a very commonly used operator when dealing with matrices, I did not try + but it should be working. Again, these shortcommings are only semi-documented as it's only meantioned that the ==, != and *= operators work.
There is no such thing in the Qt class, but if you provide sip code,
Phil may put it into PyQt.

Another mis-feature of QWMatrix is that the invert() method does not work as one would expect. It is impossible to use an inverted matrix again with Qt as it's a tuple, which to me, is useless. I recommend that this will be fixed, at least with a constructor that can create a QWMatrix from that tuple.

Yes, but the Qt version of the invert function takes a pointer to a
boolean to show whether the inverted matrix is the identity matrix.
QWMatrix.invert()[0] is the inverted matrix and [1] the boolean value.

I went mathematical and worked around this shortcommings when doing
part 14 of the tutorial.  If anyone is interested I could publish the
code, and even translate the entire tutorial into python.  I already
have most of the chapters in more or less line by line compatible code
with the text of the tutorial.


Best,

Johann

greetings

Torsten

--
Torsten Marek <[EMAIL PROTECTED]>
ID: A244C858 -- fingerprint 1902 0002 5DFC 856B F146  894C 7CC5 451E
A244 C858
www.keyserver.net -- wwwkeys.eu.pgp.net

< information must flow >



--- qwmatrix.sip        2003-09-02 13:15:39.000000000 +0200
+++ qwmatrix.sip.new    2003-09-02 13:14:55.000000000 +0200
@@ -110,10 +110,11 @@
                }
 %End
 
-       QPoint map(const QPoint &);
-       QRect map(const QRect &);
-       QPointArray map(const QPointArray &);
+       QPoint map(const QPoint &) const;
+       QRect map(const QRect &) const;
+       QPointArray map(const QPointArray &) const;
 %If (Qt_3_1_0 -)
+       QRect mapRect(const QRect &) const;    
        QRegion map(const QRegion &) const;
        QRegion mapToRegion(const QRect &) const;
        QPointArray mapToPolygon(const QRect &) const;

Attachment: file:///tmp/nsmail-2.tmp
Description: PGP signature

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to