PDA

View Full Version : what's the difference betwwen rect() and geometry()?



xiangxw
27th September 2011, 13:53
what's the difference betwwen rect() and geometry()?

nish
27th September 2011, 15:46
have you tried to read the Window Geometry chapter of QtAssistant?

jcyangzh
25th October 2012, 08:00
from qt assistant:
The rect property equals QRect(0, 0, width(), height()).
This property holds the geometry of the widget relative to its parent and excluding the window frame.

example:
suppose a pushbutton is in a mainwindow:
geometry() QRect(90,50 121x91)
size() QSize(121, 91)
rect() QRect(0,0 121x91)
width() 121
height() 91

please see the doc first. :)