I want to implement a subclass of QTableWidget, whose selection is rowselection, and which can drag and drop between items. The mimedata type are not the same for different columns.

the table widget is init with:
ObjectTableWidget->setSelectionBehavior(QAbstractItemView::SelectRow s);
ObjectTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelec tion);

I inherite the functions for qtablewidget subclass:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);

In mousePressEvent() and mouseMoveEvent(), I can create QDrag successfully.
The problem is :
1. the QDrag can not be accepted by QTableWidget even
QDragEnterEvent::acceptProposedAction() is called in dragEnterEvent(),
2. dropEvent() is not called when drop happens.

Help, Thanks!