继承 QStyledItemDelegate之后重写方法: class MyDelegate : public QStyledItemDelegate { Q_OBJECTpublic: TableWidgetDelegate(QObject *parent = 0) :QStyledItemDelegate(parent), listEditor(new ListEditor()){} ~TableWidgetDelegate(); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model,const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &inde