[Qt-interest] transformIsSimple()

Stephen Chu stephen at ju-ju.com
Tue Apr 5 19:16:05 CEST 2011


I am trying to figure out why one of my custom graphics items using 
DeviceCoordinateCache is never cached. I came to this transformIsSimple  
function at around line 4364 in qgraphicsscene.cpp. It's used to see if 
the painter's worldTransform is one of the simple 90-degree rotations 
and clear the cached pixmap if it's not.

The function seems to only test for translated and/or rotated unity 
matrix. That is, the absolute value of m11, m12, m21, and m22 all have 
to be 1. Anything scaled will return false and force the redraw of the 
item.

Is this how the test is intended for? I thought it should just test for 
simple rotation regardless of scale?

-- 
Stephen Chu



More information about the Qt-interest-old mailing list