Size based on component duration and a fixed height

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