How to add a QCompleter to a Qtreeview

Hello, good morning. I have a small application that is used to add tasks to be done, and for this I use a QTreeview. Now I want to add word autocompletion using the QCompleter class, but I haven’t been able to do so. Could you please help me?
Below is some of the code I have written so far.

class Por_Hacer(QTreeView):
    def __init__(self):
        super().__init__()
        self.setStyleSheet("background-color:#FF313131;color:white;font:bold 16px;border:None;")

        

        completar=["ABB","auto","avellana","asturia"]  
        
        
        
        completer = QCompleter(completar)
        completer.setCaseSensitivity(Qt.CaseInsensitive)
        completer.setModel(QFileSystemModel(completer))
        

        self.header().hide()
        self.setAnimated(True)

        self.my_model=QStandardItemModel(self,completer)

        
        self.setModel(self.my_model)

I would create a QItemDelegate with QLineEdit and add the completer to the line edit.

thank you ,i will try it

it worked ,i use a QStyleItemDelegate instead of QItemDelegate,thank you very much