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

Qt-interest Archive, February 2007
vertically scrolling area


Message 1 in thread

Has anyone here implemented a purely verticalling scrolling area? I
layout my widget in a container widget which I place into a
QScrollArea but that allow the scroll area to be resized very narrow
and thus a horizontal scroll bar to appear. I'd like the view to only
be able to scroll vertically. Is there a trick I'm missing? I could
probe the container widget and set the minimum column width for the
columnt he scroll area is placed in so it can't get too narrow, adding
the pixel metric width of the scroll bar and frame etc, but that seems
overly complicated...

-Will

--
 [ signature omitted ] 

Message 2 in thread

try this:

scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

Cheers,
Peter Prade

--
 [ signature omitted ] 

Message 3 in thread

Doings this has the same effect. It simply prevents a horziontal
scrollbar from ever appearing but allows the scroll area to become
very narrow. As a result content within the scroll area flows off to
the right requiring the user now to resize the window to see it which
is exactly what I want to avoid. I want the user to only ever have to
vertically scroll the view and never have to resize the view to view
content.

On 2/22/07, Peter Prade <prade@xxxxxxxxxxx> wrote:
> try this:
>
> scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
>
> Cheers,
> Peter Prade
>
>

--
 [ signature omitted ] 

Message 4 in thread

Did you try using a QScrollArea or a subclass?
You can call
QScrollArea::setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

Fabrizio


On Thu, 22 Feb 2007 12:24:53 -0500, "Will Stokes" <wstokes@xxxxxxxxx>
wrote:

>Has anyone here implemented a purely verticalling scrolling area? I
>layout my widget in a container widget which I place into a
>QScrollArea but that allow the scroll area to be resized very narrow
>and thus a horizontal scroll bar to appear. I'd like the view to only
>be able to scroll vertically. Is there a trick I'm missing? I could
>probe the container widget and set the minimum column width for the
>columnt he scroll area is placed in so it can't get too narrow, adding
>the pixel metric width of the scroll bar and frame etc, but that seems
>overly complicated...
>
>-Will

--
 [ signature omitted ] 

Message 5 in thread

Ah jeesh. I'm not sure why I can't get this threw people's heads.
Setting a  scrollbar policy has no effect on the minimum size hint of
a scroll area. It simply dictates when scrollbars are shown. I have
finally figured out a solution to my problem. I subclassed QScrollArea
and reimplemented minimumSizeHint().



On 2/22/07, Fabrizio Angius <hippydream@xxxxxxxxx> wrote:
>
> Did you try using a QScrollArea or a subclass?
> You can call
> QScrollArea::setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
>
> Fabrizio
>
>
> On Thu, 22 Feb 2007 12:24:53 -0500, "Will Stokes" <wstokes@xxxxxxxxx>
> wrote:
>
> >Has anyone here implemented a purely verticalling scrolling area? I
> >layout my widget in a container widget which I place into a
> >QScrollArea but that allow the scroll area to be resized very narrow
> >and thus a horizontal scroll bar to appear. I'd like the view to only
> >be able to scroll vertically. Is there a trick I'm missing? I could
> >probe the container widget and set the minimum column width for the
> >columnt he scroll area is placed in so it can't get too narrow, adding
> >the pixel metric width of the scroll bar and frame etc, but that seems
> >overly complicated...
> >
> >-Will
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ]