I need the widgets in my gridlayout to be stretched so that it'll occupy the available space without any gaps. But I could'nt get that working.

I have a QMainWindow, on which I have QStackedWidget as centralWidget. I have added a page (QWidget) to QStackedWidget and set QGridLayout to the page.
Now I've added 3 QPushButtons in the top row of QGridLayout and 2 QPushButtons in the next row. I'm expecting the QPushButtons stretching across the layout both interms of horizontal & vertical spacing. Buthe buttons are of small size leaving large gaps in the layout. I tried the stretching, sizePolicy, but in vain. Please help me fix the issue.
Thank you.

Qt Code:
  1. lyt->addWidget(m_pbVulnerability, 0, 0, 2, 3, Qt::AlignCenter);
  2. lyt->addWidget(m_pbPatch, 0, 3, 2, 3, Qt::AlignCenter);
  3. lyt->addWidget(m_pbConfig, 0, 6, 2, 3, Qt::AlignCenter);
  4. lyt->addWidget(m_pbScan, 1, 3, 2, 6, Qt::AlignCenter);
  5. lyt->addWidget(m_scanTimeSelect, 5, 3, 2, 3, Qt::AlignCenter);
  6. lyt->addWidget(m_pbUpdate, 5, 6, 2, 3, Qt::AlignCenter);
To copy to clipboard, switch view to plain text mode