def METHOD_NAME(self, pm):
    parent = self.parent()
    if parent is None:
        return -1
    elif parent.isWidgetType():
        return parent.style().pixelMetric(pm, None, parent)
    else:
        return parent.spacing()