code: def template_chooser_clicked(self):
          
          path = self.template_path.text()
          if not path:
              path = setting('lastCustomTemplate', '', str)
          if path:
              directory = dirname(path)
          else:
              directory = ''
          # noinspection PyCallByClass,PyTypeChecker
          file_name = QFileDialog.getOpenFileName(
              self,
              tr('Select report'),
              directory,
              tr('QGIS composer templates (*.qpt *.QPT)'))
          self.template_path.setText(file_name)
docs: Slot activated when report file tool button is clicked.
  
          .. versionadded: 4.3.0