解决方法
您可以使用bool QAbstractItemModel :: removeRow(int row,const QModelIndex& parent = QModelIndex())功能.
在这里你可以找到所有这一切的example.
此外,这是该文档的内联引用:
removeRows()
Used to remove rows and the items of data they contain
from all types of model. Implementations must call beginRemoveRows()
before inserting new columns into any underlying data structures,and
call endRemoveRows() immediately afterwards.
该任务的第二部分是将按钮的单击信号连接到执行删除的插槽.