My bad, I misread the example, items are indeed added.
The bug is that the items are added at positions like -4200000, 536, but the top-left corner of the scene is set to (0, 0). The defOffset variable, which is added to all X coordinates, seems to be uninitialized. Removing this variable, or setting it to 0, gives me rects and diamonds.
Bookmarks