title: PyQt dynamic adding tab with buttons - layout issue
body: <p>I'm trying to create a system that will automatically add tabs according to how many product types there are and then automatically add buttons within their corresponding tab for the items, but for some reason all the tabs have the same button as the first tab, I'm pretty sure this has something to do with the layout but I'm not sure what exactly image: <img src="https://i.stack.imgur.com/uWUhO.png" alt="enter image description here"></p>
  
  <pre><code>        typetab = QtGui.QTabWidget(self)
          types = producttypes() ##returns a tuple with type names e.g. [('Drinks',), ('Food',)]
  
          for name in types:
              tab = QtGui.QWidget()
              typetab.addTab(tab, name[0])
              products = typeitems(name[0]) ## returns items of that product type [('Coke',), ('Pepsi',)]
              typetablayout = QtGui.QGridLayout()
              for length in range(math.floor(len(products)/5) + 1):
                  for width in range(5):
                      try:
                          button = QtGui.QPushButton(products[width][0])
                          button.setObjectName(products[width][0])
                          typetablayout.addWidget(button,length, width)
                      except IndexError:
                          break
                      print([length,width])
              typetab.setLayout(typetablayout)
  </code></pre>