docstr: Adds a button to the right side of the QLineEdit.
  
  Args:
      button: Type QtWidgets.QPushButton or QtWidgets.QToolButton
docstr_tok: ["Adds","a","button","to","the","right","side","of","the","QLineEdit",".","Args",":","button",":","Type","QtWidgets.QPushButton","or","QtWidgets.QToolButton"]
code: def add_button(self, button):
      """
      Adds a button to the right side of the QLineEdit.
  
      Args:
          button: Type QtWidgets.QPushButton or QtWidgets.QToolButton
      """
      self.buttons.append(button)
  
      # makes sure text doesn't type behind the buttons
      totalWidth = sum([b.sizeHint().width() for b in self.buttons])
      frameWidth = self.style().pixelMetric(
          QtWidgets.QStyle.PM_DefaultFrameWidth
      )
  
      # makes sure the typing area doesn't get too small if toolbar is shrunk.
      maxHeight = max([b.sizeHint().height() for b in self.buttons])
      self.setMinimumSize(
          max(
              self.minimumSizeHint().width(),
              totalWidth + frameWidth * 2 + 2,
          ),
          max(
              self.minimumSizeHint().height(),
              maxHeight + frameWidth * 2 + 2,
          ),
      )
  
imports: import re
  import time
  import pkg_resources
  from PyQt5 import QtCore, QtGui, QtWidgets
  from PyQt5.QtCore import Qt
label_desc: Use image node_id 3 for calling the ButtonLineEdit obj's underlying member method code with example usage: obj.add_button(button) without return types