code: def __init__(
      self, text="Enter object label", parent=None, listItem=None
  ):
      super(LabelDialog, self).__init__(parent)
  
      self.edit = QLineEdit()  # OLD
      # self.edit = QTextEdit()
      self.edit.setText(text)
      # self.edit.setValidator(labelValidator()) # 验证有效性
      self.edit.editingFinished.connect(self.postProcess)
  
      model = QStringListModel()
      model.setStringList(listItem)
      completer = QCompleter()
      completer.setModel(model)
      self.edit.setCompleter(completer)
  
      layout = QVBoxLayout()
      layout.addWidget(self.edit)
      self.buttonBox = bb = BB(BB.Ok | BB.Cancel, Qt.Horizontal, self)
      bb.button(BB.Ok).setIcon(newIcon("done"))
      bb.button(BB.Cancel).setIcon(newIcon("undo"))
      bb.accepted.connect(self.validate)
      bb.rejected.connect(self.reject)
      layout.addWidget(bb)
  
      # if listItem is not None and len(listItem) > 0:
      #     self.listWidget = QListWidget(self)
      #     for item in listItem:
      #         self.listWidget.addItem(item)
      #     self.listWidget.itemClicked.connect(self.listItemClick)
      #     self.listWidget.itemDoubleClicked.connect(self.listItemDoubleClick)
      #     layout.addWidget(self.listWidget)
  
      self.setLayout(layout)
  
file_path: PaddleOCR/PPOCRLabel/libs/labelDialog.py
imports: from libs.utils import newIcon, labelValidator
label_desc: Use image node_id 1 to create a new LabelDialog object from inherited base classes: QDialog with example: obj = LabelDialog(text, parent, listItem)