January 2016
Beginner
512 pages
12h 35m
English
Let's have a closer look at these three items defined by the following code snippet:
QGraphicsRectItem *itemA = QGraphicsRectItem(-10, -10, 20, 20); QGraphicsRectItem *itemB = QGraphicsRectItem(0, 0, 20, 20); QGraphicsRectItem *itemC = QGraphicsRectItem(10, 10, 20, 20);
All three items are rectangles with a side length of 20 pixels. The difference between them is the position of their coordinate origin points. itemA has its origin in the center of the rectangle, itemB has its origin in the top-left corner of the rectangle, and itemC has its origin outside the drawn rectangle. In the following diagram, you see the origin points marked as red dots.
So what's the deal with ...