From kde-devel Sat Mar 31 11:05:32 2001 From: Carsten Pfeiffer Date: Sat, 31 Mar 2001 11:05:32 +0000 To: kde-devel Subject: Re: Question for Qt experts about geometry management... X-MARC-Message: https://marc.info/?l=kde-devel&m=98603818605664 Am Montag, 26. März 2001 05:24 schrieb Pascal A. Niklaus: Hi, > What I'd like to do is a geometry management that allows widgets (in a > QFrame, managed by QGridLayout) to grow so that they fill a QScrollView > horizontally (but don't get larger! There will therefore never be a > horizontal scrollbar). > However, the QFrame (in the QScrollView) should be allowed to grow higher > (vertically larger) than the QScrollView... (there will then be a vertical > scrollbar). > > Currently, the problem is: > - if I don't use a QScrollView-derived widget, the stuff behaves exactly as > I want, but there is of course no vertical scrollbar... > - if I put everything in a QScrollView, the view expands horizontally to > ca. 3x the width of the QScrollView, which is awkward... > > I was looking for some sizePolicy in the QGridLayout, but could not find > what I needed. I also checked the sizeHint() of the individual widgets, > but it is well below the width where there would be a need to expand > everything horizontally to a size larger than the current QScrollViews > width. does it help if you call frame->setFixedWidth( scrollView->viewport()->width() ); scrollview->setHScrollBarMode( QScrollView::AlwaysOff ); // maybe needed Just make sure to always adjust the frame's width when the scrollview is resized. Cheers, Carsten Pfeiffer >> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<