docs: def set_button_visible(self, visible):
          """
          Sets the clear button as ``visible``
  
          :param visible: Visible state (True = visible, False = hidden).
          """
          self.button.setVisible(visible)
          left, top, right, bottom = self.getTextMargins()
          if visible:
              right = self._margin + self._spacing
          else:
              right = 0
          self.setTextMargins(left, top, right, bottom)