def layoutDirectionChanged(self, index): if index == 0: self.setLayoutDirection(Qt.LeftToRight) else: self.setLayoutDirection(Qt.RightToLeft)