Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, June 2007
QFrame Layout


Message 1 in thread

Hi all,

I'm after some help with a QFrame and making it into a QScrollArea. In 
Designer I'm using the promote idea to make the QFrame into a 
QScrollArea, but then I would like the stuff I put inside the QFrame to 
be part of a layout which stretches horizontally, but fills vertically 
as much as it needs.

Maybe that isn't clear...

So basically I want part of my main window to be scrollable. When the 
window is resized horizontally, the widgets in the scroll area should 
resize horizontally to fill the area. Obviously if the size gets too 
small then a scrollbar should appear. But when resized vertically I want 
the scrollable area to just stay the same and put a scrollbar if necessary.

Any ideas how I can do this using Designer?

Many thanks,
Matt Galloway

--
 [ signature omitted ] 

Message 2 in thread

On 02.06.07 17:43:08, Matt Galloway wrote:
> Hi all,
> 
> I'm after some help with a QFrame and making it into a QScrollArea. In Designer 
> I'm using the promote idea to make the QFrame into a QScrollArea, but then I 
> would like the stuff I put inside the QFrame to be part of a layout which 
> stretches horizontally, but fills vertically as much as it needs.
> 
> Maybe that isn't clear...
> 
> So basically I want part of my main window to be scrollable. When the window is 
> resized horizontally, the widgets in the scroll area should resize horizontally 
> to fill the area. Obviously if the size gets too small then a scrollbar should 
> appear. But when resized vertically I want the scrollable area to just stay the 
> same and put a scrollbar if necessary.
> 
> Any ideas how I can do this using Designer?

You can't. You need to do the resizing yourself because this goes
against the idea of the scrollarea.

Another option might be to implement your own QWidget or QFrame subclass
and add just one scrollbar. Then write your own resizeEvent handler and
do what you want there.

Andreas

-- 
 [ signature omitted ]