PDA

View Full Version : QHBoxlayout Size problem



Spitz
4th December 2008, 13:27
Hi.

I'm having some troubles to stretch a widget on the screen.

On my QmainWindow I create a Qwidget that I use as centralWidget.
On my this QWidget( in my code mainWidget), I set a QHBoxlayout.

In this HBoxlayout, I add 2 items, one is a QVBoxlayout, and another is an Widget, wich has an QGraphicsView and Scene.

When I add the widget like this:



m_centralWidget = new QWidget(this);
m_hboxlay = new QHBoxLayout(m_centralWidget);
m_vboxlay = new QVBoxLayout();
[...]
m_hboxlay->addLayout(m_vboxlay,0);
m_hboxlay->addWidget(m_bordWidget,1);
setCentralWidget(m_centralWidget);


I get something like this:
http://lumumba.uhasselt.be/spitz/crap/Screenshot.png

As marked on the image with a red arrow, I would like to have that my bordWidget is stretched so it occupies the whole screen. I could set a fixedSize(int, int), but then on other resolutions, it would not fit.

Can someone point me out how to do this?


Thanks in advance,


Spitz

jpn
4th December 2008, 18:07
Does that "another Widget, wich has an QGraphicsView and Scene" have a layout installed?

PS. Please attach screenshots next time.

Spitz
4th December 2008, 21:09
Thank you, that was the problem.

I added the view in a layout, and now it's ok!

Thank you very much, and next time I'll add screen as attachment.