On 5/27/20 3:58 PM, Matthew Woehlke wrote:

*Nothing*  there clearly states, at least to my reading, whether the
"new" transform happens*before*  or*after*  any existing transforms that
the QTransform is already doing.

IMO, changing this to clarify that would help significantly.

Sure, augmenting the docs would help. But <devil's advocate> the whole point of the API is for its usage to be straightforward. If you do

QTransform t;
t.translate();
t.rotate();
t.scale();
auto result = t.map(foo);


the "obvious" meaning should be that foo is getting first translated, then rotated, then scaled; not the other way around.

If this is achieved by pre or postmultiplication of (transposed) matrices matters only if you're into Algebra&Geometryâ„¢ -- i.e. poking into the actual matrix, or if you're combining two transforms by means of operator*. Otherwise, it is not interesting at all in 99% of the cases, where you'd just set the transform on a painter or an item similar.

If you really want to use the "low levels", please also note that operator* is helping you:

QTransform t1, t2;
QTransform t = t1 * t2; // ok...

auto result = foo * t;  // can only premultiply!
                        // operator*(t, foo) does not exist

So you've built foo * t1 * t2, with t1 applied first. (This in turn should reveal how QTransform works internally.)

</devil's advocate>

My 2 c,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to