'Set alignment of text items in the widget'

def setAlignment(self, alignment):

    self.alignment = alignment
    layout = self.layout()
    for i in range(layout.count()):
        layout.setAlignment(layout.itemAt(i), alignment)
