def actionEvent(self, event): QToolButton.actionEvent(self, event) if event.type() == QEvent.ActionChanged or \ event.type() == QEvent.ActionAdded: self.__textLayout()