code: def sizeHint(self, option, index):
          
          # calculate size by data component
          component = index.internalPointer()
          width = self.component.duration() * self.pixelsPerms*1000
          return QtCore.QSize(width, 50)
docs: Size based on component duration and a fixed height