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:

Qt Code:
  1. m_centralWidget = new QWidget(this);
  2. m_hboxlay = new QHBoxLayout(m_centralWidget);
  3. m_vboxlay = new QVBoxLayout();
  4. [...]
  5. m_hboxlay->addLayout(m_vboxlay,0);
  6. m_hboxlay->addWidget(m_bordWidget,1);
  7. setCentralWidget(m_centralWidget);
To copy to clipboard, switch view to plain text mode 

I get something like this:


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