title: Pyside6: Create QTabWidget with function rather than class
body: <p>I've been trying to make an application using Pyside6 and can't seem to understand why we can't create a QDialog having QTabWidget with just functions.
  I am not sure if I am making a mistake somewhere so, here is the code I've wrote:</p>
  <p>Imports:</p>
  <pre><code>from PySide6.QtWidgets import (QMessageBox, QApplication, QWidget, QGridLayout, QLabel, QMainWindow, QTabWidget,
                                 QVBoxLayout)
  from sys import argv
  </code></pre>
  <p>2 Tabs function:</p>
  <pre><code>def WelPage():
      grid = QGridLayout()
      wel_tab = QWidget()
      wel_tab.setLayout(grid)
  
      lab_name = QLabel(&quot;This is a label&quot;)
      git_link = QLabel(&quot;This is a link&quot;)
      git_link.setOpenExternalLinks(True)
      yt_link = QLabel(&quot;Another Link&quot;)
      yt_link.setOpenExternalLinks(True)
  
      grid.addWidget(lab_name, 0, 1)
      grid.addWidget(git_link, 1, 0)
      grid.addWidget(yt_link, 1, 3)
  
  
   def AboutPage():
      about_tab = QWidget()
      lo = QVBoxLayout()
      purpose = QLabel(&quot;A really long label&quot;)
  
      lo.addWidget(purpose)
      about_tab.setLayout(lo)
  </code></pre>
  <p>And the main function:</p>
  <pre><code>def main():
      w = QWidget()
      layout = QVBoxLayout()
      tw = QTabWidget()
      w.resize(450, 250)
      w.setWindowTitle('Window Title')
      layout.addWidget(tw)
  
      tw.addTab(WelPage(), &quot;Welcome Screen&quot;)
      tw.addTab(AboutPage(), &quot;About&quot;)
      tw.show()
  
      w.setLayout(layout)
      w.show()
      app.exec()
  
  
  if __name__ == &quot;__main__&quot;:
      app = QApplication(argv)
      main()
  </code></pre>
  <p>Output:
  <a href="https://i.stack.imgur.com/Ol7pq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ol7pq.png" alt="SC of Blank canvas" /></a></p>
  <p>All this does is render a blank Dialog. Not sure why that is. Why must I be forced to use a class rather than this method?</p>