PDA

View Full Version : width()



mickey
25th July 2006, 11:37
hi, I put at begin of paintGL that code but print strange things.......



cout << " size.width() " << size().width() << " " << " size.height() " << size().height() << endl;



// at start of app
size.width() 101 size.height() 31
paintGL
size.width() 101 size.height() 31
paintGL



//after a rotation or traslation
size.width() 320 size.height() 340
paintGL
size.width() 447 size.height() 363
paintGL

why this change of values printed?? thanks

wysota
25th July 2006, 12:14
What is "size"? What gets rotated and translated? What is the rotation?

mickey
25th July 2006, 12:51
we are inside paintGL so size is the member of myWidgetGL; doesn't important what rotate do...but it's called with mouseMove+mousedown and it call an update().....when update is called I can see change value of size().width() change (the value printed from cout in PaintGL() )...........then: at start app I see some values of width() end height(); when I call update these values changed.... (I don't resize the app....)

wysota
25th July 2006, 12:59
Are those initial values correct? Remember that widgets show an incorrect size before show() is called for the first time. And when those values change, does the widget actually get resized? The changes are significant, so you'd surely notice that. Which values are correct?

mickey
25th July 2006, 16:56
correct are:
size.width() 447 size.height() 363 I put it inside resizeGL and see it....)
but the widget isn't resize when value correct appear...I don't see it....

mickey
27th July 2006, 14:45
ok my app start with wrong width() and hieght() values.....to see correct values I need to dragging corner app and so call resizeGL. Why? can I force th resizeGL() call? thanks

wysota
27th July 2006, 15:12
I think I already told you why...


Remember that widgets show an incorrect size before show() is called for the first time.

mickey
27th July 2006, 16:18
thanks its ok. in fact I have a widget that is in a tab page don't sown at startUP and its values are 1, 29.....