qt-interest@trolltech.com
[Top] [All Lists]

Qt4: geometry() does not return the position of the top left corner of a

Subject: Qt4: geometry() does not return the position of the top left corner of a widget?
From: Fu Limin
Date: Wed, 16 Nov 2005 11:24:44 +0100
Hello,

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!

Regards,

Limin

<Prev in Thread] Current Thread [Next in Thread>