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

Qt-interest Archive, February 2007
QSplitter in a QScrollArea


Message 1 in thread

Hi,

I have a problem with putting a QSplitter inside a QScrollArea. Here's
what I tried:

QScrollArea scrollArea;
QSplitter splitter;
scrollArea.setWidget(&splitter);
splitter.addWidget(new QLabel("A"));
splitter.addWidget(new QLabel("B"));
splitter.addWidget(new QLabel("C"));
scrollArea.show();

This displays an empty widget. Displaying the splitter alone works, and
putting a label into the scroll area works as well. Any Idea what I
might be doing wrong?

M

--
 [ signature omitted ] 

Message 2 in thread

Martin wrote:
> Hi,
> 
> I have a problem with putting a QSplitter inside a QScrollArea. Here's
> what I tried:
> 
> QScrollArea scrollArea;
> QSplitter splitter;
> scrollArea.setWidget(&splitter);
> splitter.addWidget(new QLabel("A"));
> splitter.addWidget(new QLabel("B"));
> splitter.addWidget(new QLabel("C"));
> scrollArea.show();
> 
> This displays an empty widget. Displaying the splitter alone works, and
> putting a label into the scroll area works as well. Any Idea what I
> might be doing wrong?
> 
> M


Oookay, QScrollArea::setWidgetResizable(true) seems to do the trick...

--
 [ signature omitted ]