title: QtabWidget and QMainWindow in one class
body: <p>Is there a way to define the menubar in a QtabWidget class ?</p>
  
  <p>I wrote a code for a destopapplication with pyqt5 and python 3.6. I would like to set the manuBar in the same class as the Tabs but my code returns qtabwidget has no attribute QMainWindow.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import sys
  from PyQt5 import QtWidgets, QtCore, QtPrintSupport, QtGui
  from PyQt5.QtWidgets import *
  
  class main_window(QTabWidget):
      def __init__(self, parent=None):
          super(QTabWidget, self).__init__(parent)
          self.setGeometry(50, 50, 1100, 750)
          self.setWindowTitle("Programm")  #
  
          self.centralWidget = QtWidgets.QWidget()
          self.tabWidget = QtWidgets.QTabWidget(self.centralWidget)
          self.tabWidget.setGeometry(QtCore.QRect(10, 10, 1200, 1000))
  
          open_new_file = QAction('New', self)
  
          mainMenu = self.menuBar()
          fileMenu = mainMenu.addMenu('Projekt')
  
  
          fileMenu.addAction(open_new_file)
          self.table_widget = MyTableWidget(self)
          self.setCentralWidget(self.table_widget)
  
          self.show()
  
          self.tab_v1 = QtWidgets.QWidget()
          self.addTab(self.tab_v1, "Tab 1")
  
          self.tab_v2 = QtWidgets.QWidget()
          self.addTab(self.tab_v2, "Tab 2")
  
          self.openFile = QPushButton("Choose Tab ", self.tab_v1)
          self.openFile.setGeometry(QtCore.QRect(700, 25, 200, 30))
  
  
  def main():
      app = QApplication(sys.argv)
      ex = main_window()
      ex.show()
      sys.exit(app.exec_())
  
  
  if __name__ == '__main__':
      main()
  </code></pre>