PyQt5 - Can QTabWidget content extend up to Main Window edges, even with no content?
<p>I am new to PyQt5... Simple question here.</p>

<p>I am using PyQt5 to build a simple application. This application has a Main Window containing a QTabWidget with 3 tabs. Once the application starts, all tab pages are empty and get filled later on. When tab pages are empty, I would still like them to appear as blank pages and extend up to the Main Window edges.</p>

<p>I've been trying to achieve this in two ways: using a layout and using the setGeometry function. Yet the tab pages never extend vertically very far, and horizontally they never go beyond the last tab. See code below.</p>

<pre><code>import sys
from PyQt5.QtWidgets import *


class MainWindow(QWidget):

    def __init__(self):

       super().__init__()

       self.setWindowTitle("Window With Tabs")
       self.setGeometry(50,50,400,400)

       oTabWidget = QTabWidget(self)

       oPage1 = QWidget()
       oLabel1 = QLabel("Hello",self) 
       oVBox1 = QVBoxLayout() 
       oVBox1.addWidget(oLabel1)      
       oPage1.setLayout(oVBox1)

       oPage2 = QWidget()
       oPage2.setGeometry(0,0,400,400)

       oPage3 = QWidget()
       oPage3.setGeometry(0,0,400,400)              

       oTabWidget.addTab(oPage1,"Page1")
       oTabWidget.addTab(oPage2,"Page2")
       oTabWidget.addTab(oPage3,"Page3")      

       self.show()


if __name__ == "__main__":

    app = QApplication(sys.argv)

    oMainwindow = MainWindow()

    sys.exit(app.exec_())
</code></pre>

<p><a href="https://i.stack.imgur.com/jbR2e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jbR2e.png" alt="enter image description here"></a></p>

<p>Any idea how to modify the code so the empty pages will extend up to the edges of Main Window ?</p>