'Size hint is the maximum width and median height of the widgets
contained in the stack.'

def sizeHint(self):

    default_size = QSize(200, 400)
    widget_hints = [default_size]
    for i in range(self.count()):
        hint = self.widget(i).sizeHint()
        widget_hints.append(hint)
    width = max([s.width() for s in widget_hints])
    height = numpy.median([s.height() for s in widget_hints])
    return QSize(width, int(height))
