Currently in the study of Qt, to the coordinate system this piece of time, a little messy, after looking at a few related blog, sure enough ... More messy, until you read the Qt Help Handbook (shouldn't you be the first to see this?).
1. Translate (), this is quite a good understanding, this function requires a vector of information, the bearer of this information may be:
1.1 One point: the const qpoint &offset (floating-point const qpointf &offset) Vector is pointed to by the origin point;
1.2 Two real numbers, that is, two sub-vectors, the resultant vector is the required information;
When this information is obtained, the origin is shifted according to this vector, which is translate ().
2. SetWindow (), create a map, it needs to be a rectangle of information, because it will map the current window with this rectangle, you can directly give it a rectangle const qrect &rectangle, or give it a point in the upper left corner (int x, in T y) and its width and height (int width, int heigh). such as Painter.setwindow (rectangle) means to use rectangle and painter the current window to map. Of course the meaning of this layer is limited to only this one function, because if there are more than one function, then it means setting up Microsoft System (set Windows) ... Well, I know the joke is cold.
3. SetViewport (), also establishes a mapping with the current window, as needed, but in contrast to SetWindow, it is a mapping of the current window to the given rectangle.
My understanding of SetWindow, setviewport and translate