PDA

View Full Version : QScrollView size policy?



Henrikas[MI]
7th November 2006, 09:42
Hi all,
I have some parent widget QVBox containing child widget QScrollView. Now the parent needs to shrink sometimes and even become 0 height if there's no more space, but no matter what size policy I set, QScrollView stops shrinkinkg at some 100px. Any ideas what makes QScrollView stop from shrinking? :confused:



class Parent : public QVBox
{
QScrollView* child;

public:
Parent() {
child = new QScrollView( this);
child->setResizePolicy( QScrollView::AutoOneFit); // need this one for sub-child to expand
child->setMinimumHeight( 0); // ignored?
}

void Shrink() {
setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum, 1, 0));
}
}

wysota
19th November 2006, 10:52
Does the scroll view have any children? Maybe you should set a minimum size on the viewport?