PDA

View Full Version : height()



mickey
22nd March 2006, 15:02
Hi,


QPushButton* b = new QPushButton(myFrame);
b->setGeometry(20,90, 100,40);
myFrame->setGeometry(0,0,200, height() );
I'd like height of myFrame is equal to height() if it return a value that can contain button b;
Otherwise I'd like add a value to height to make b buton visible. How do it? Exist a function that return the value minimun_height_to_contain_the_object_inserted? Or Do I implement it?
(the height() value change in relation to height of my application window and this I want! but the button b is not visible)

bitChanger
22nd March 2006, 20:32
I think this is what you are asking for.




QPushButton* b = new QPushButton(myFrame);
b->setGeometry(20,90, 100,40);

int minHeight = (b->height() > height()) ? b->height() : height();

myFrame->setGeometry(0,0,200, minHeight );