'Set `action` to be displayed at `position`. Existing action
(if present) will be removed.
Parameters
action : :class:`QAction`
position : int
Position where to set the action (default: ``LeftPosition``).'

def setAction(self, action, position=LeftPosition):

    curr = self.actionAt(position)
    if (curr is not None):
        self.removeAction(position)
    QLineEdit.addAction(self, action)
    button = LineEditButton(self)
    button.setToolButtonStyle(Qt.ToolButtonIconOnly)
    button.setDefaultAction(action)
    button.setVisible(self.isVisible())
    button.show()
    button.setCursor(Qt.ArrowCursor)
    button.triggered.connect(self.triggered)
    button.triggered.connect(self.__onTriggered)
    slot = _ActionSlot(position, action, button, False)
    self.__actions[(position - 1)] = slot
    if (not self.testAttribute(Qt.WA_Resized)):
        self.adjustSize()
    self.__layoutActions()
