def setText(self, text): LOGGER.debug("setting text %s", text) CompletionTextEdit.setText(self, text.strip("\n").title()) cursor = self.textCursor() cursor.movePosition(cursor.End, cursor.MoveAnchor) self.setTextCursor(cursor)