I found geometry() didn't work as I expected. From the documentation,
geometry should return a rectangle with
its top left point having the coordinates of the top left corner of the
widget relative to its parent widget. But I found,
it is not, the coordinates are always 0.
In my program, what I was trying to do is, place some children widgets
in a grid layout of their parent widget,
each of the child widget draw some graphics on itself, and then have a
function to save what are drawn on
the children widgets as a single image. The simplest way I thought
should be, get the position and the size of each
child widget and call its function to draw itself on the corresponding
part of a pixmap. I thought geometry() should
work perfectly for this purpose, but to my surprise, it did not.
Any hints? Thanks!