Qt-interest Archive, July 2007
Strange(?) behavior when using QScrollArea
Message 1 in thread
Hi again all,
Seems like I'm spamming the list these days. Oh well.
So, I want to have a scrollable area on one side in my application, and
display a custom widget on the other. I place them using a QHBoxLayout, but
only the QScrollArea is visible. However, if I replace the custom widget with
a QPushButton or the likes, then both is displayed. If I replace the
QScrollArea with a QPushButton or something similar, then both that and the
custom widget is displayed. Is there something in the docs about QScrollArea
that I have missed?
Best,
Christopher
--
[ signature omitted ]
Message 2 in thread
tried adjusting your widgets sizePolicy?
Am Samstag, 28. Juli 2007 14:44 schrieb Christopher Rasch-Olsen Raa:
> Hi again all,
>
> Seems like I'm spamming the list these days. Oh well.
>
> So, I want to have a scrollable area on one side in my application, and
> display a custom widget on the other. I place them using a QHBoxLayout, but
> only the QScrollArea is visible. However, if I replace the custom widget
> with a QPushButton or the likes, then both is displayed. If I replace the
> QScrollArea with a QPushButton or something similar, then both that and the
> custom widget is displayed. Is there something in the docs about
> QScrollArea that I have missed?
>
>
> Best,
> Christopher
>
> --
> 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 ]
Message 3 in thread
On Saturday 28 July 2007 16:28:08 Thomas LÃbking wrote:
> tried adjusting your widgets sizePolicy?
Huh. It seems like that fixed it. I set the custom widget to
QSizePolizy::MinimumExpanding and suddenly it worked. It used to be set to
QSizePolicy::Preferred.
What puzzles me is why it showed when I didn't have the QScrollArea there, and
didn't show when the QScrollArea were there. If anyone could enlighten me I'd
be gratefull. :)
> Am Samstag, 28. Juli 2007 14:44 schrieb Christopher Rasch-Olsen Raa:
> > Hi again all,
> >
> > Seems like I'm spamming the list these days. Oh well.
> >
> > So, I want to have a scrollable area on one side in my application, and
> > display a custom widget on the other. I place them using a QHBoxLayout,
> > but only the QScrollArea is visible. However, if I replace the custom
> > widget with a QPushButton or the likes, then both is displayed. If I
> > replace the QScrollArea with a QPushButton or something similar, then
> > both that and the custom widget is displayed. Is there something in the
> > docs about QScrollArea that I have missed?
> >
> >
> > Best,
> > Christopher
--
[ signature omitted ]
Message 4 in thread
The ScrollAreas sizePolicy is gready "all you can get"
If your widget is nice ("take what's left") it's shrinked to it's minimum size
- probably (0,0) and you just can't see it (though it's still shown)
you can also impact the ratio between the widgets in a boxlayout
(QBoxLayout::setStretchFactor ( QWidget * widget, int stretch )) so e.g. both
grows but one faster than the other...
Thomas
Am Samstag, 28. Juli 2007 18:01 schrieb Christopher Rasch-Olsen Raa:
> On Saturday 28 July 2007 16:28:08 Thomas LÃbking wrote:
> > tried adjusting your widgets sizePolicy?
>
> Huh. It seems like that fixed it. I set the custom widget to
> QSizePolizy::MinimumExpanding and suddenly it worked. It used to be set to
> QSizePolicy::Preferred.
>
> What puzzles me is why it showed when I didn't have the QScrollArea there,
> and didn't show when the QScrollArea were there. If anyone could enlighten
> me I'd be gratefull. :)
>
> > Am Samstag, 28. Juli 2007 14:44 schrieb Christopher Rasch-Olsen Raa:
> > > Hi again all,
> > >
> > > Seems like I'm spamming the list these days. Oh well.
> > >
> > > So, I want to have a scrollable area on one side in my application, and
> > > display a custom widget on the other. I place them using a QHBoxLayout,
> > > but only the QScrollArea is visible. However, if I replace the custom
> > > widget with a QPushButton or the likes, then both is displayed. If I
> > > replace the QScrollArea with a QPushButton or something similar, then
> > > both that and the custom widget is displayed. Is there something in the
> > > docs about QScrollArea that I have missed?
> > >
> > >
> > > Best,
> > > Christopher
>
> --
> 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 ]