title: How to add a tab to QTabWidget using the button on the form?
body: <p>I decided to write a visual form for my script.
  The idea is to have a button that will add new tabs to QTabWidget. It does not work and I can not find a good example. I use PyQt5. Here's a piece of what I've tried:</p>
  
  <pre><code>import sys
  from PyQt5.QtGui import QIcon
  from PyQt5 import QtCore, QtWidgets
  
  class mainForm(QtWidgets.QWidget):
      def __init__(self):
          super().__init__()
          self.runUi()
  
      def runUi(self):
          self.resize(250, 150)
          self.move(300, 300)
          self.setWindowTitle('Let\'s Rock!')
          self.setWindowIcon(QIcon('icon.png'))
          self.setMaximumSize(QtCore.QSize(560, 522))
          self.setMinimumSize(QtCore.QSize(560, 522))
  
          groupBoxGD = QtWidgets.QGroupBox('Соединение с ГД', self)
          groupBoxGD.setGeometry(QtCore.QRect(10, 10, 541, 151))
  
          hrLWGDLink = QtWidgets.QWidget(groupBoxGD)
          hrLWGDLink.setGeometry(QtCore.QRect(10, 10, 521, 31))
          hrLGD = QtWidgets.QHBoxLayout(hrLWGDLink)
          hrLGD.setContentsMargins(0, 0, 0, 0)
  
          btnAddTab = QtWidgets.QPushButton(hrLWGDLink)
          btnAddTab.setText('Add tab')
          hrLGD.addWidget(btnAddTab)
  
          tabWidget = QtWidgets.QTabWidget(groupBoxGD)
          tabWidget.setGeometry(QtCore.QRect(10, 170, 541, 351))
          btnAddTab.clicked.connect(self.addProjectTab)
          self.show()
  
      def addProjectTab(self):
          tab = QtWidgets.QWidget()
          #how add tab at this line?
  
  if __name__ == '__main__':
      app = QtWidgets.QApplication(sys.argv)
      ui = mainForm()
      sys.exit(app.exec_())
  </code></pre>