Hi

I'm trying to drag a QTreeWidgetItem from a custom QTreeWidget into a QTableWidget.
My problem is that i always have the forbiden cursor when I'm on the QTableWidget, and I never received the "drop" event!

This is the code in my custom QTreeWidget
Qt Code:
  1. void QTreeWidgetDragDrop::mousePressEvent(QMouseEvent *event)
  2. {
  3. // Get current selection
  4. QTreeWidgetItem *selectedItem = currentItem();
  5.  
  6. // If the selected Item exists
  7. if (selectedItem)
  8. {
  9. // Create data
  10. QMimeData *mimeData = new QMimeData();
  11. mimeData->setText("hello");
  12.  
  13. // Create drag
  14. QDrag *drag = new QDrag(this);
  15. drag->setMimeData(mimeData);
  16.  
  17. drag->exec(Qt::CopyAction);
  18. }
  19.  
  20. QTreeWidget::mousePressEvent(event);
  21. }
To copy to clipboard, switch view to plain text mode 

and this is the code I have in my custom QTableWidget
Qt Code:
  1. void QTableWidgetDragDrop::dragEnterEvent(QDragEnterEvent *event)
  2. {
  3. qDebug() << "dragEnterEvent text: " << event->mimeData()->text();
  4.  
  5. // Allways accept at first
  6. event->acceptProposedAction();
  7.  
  8. QTableWidget::dragEnterEvent(event);
  9. }
To copy to clipboard, switch view to plain text mode 

And this is the function to catch the drop event
Qt Code:
  1. void QTableWidgetDragDrop::dropEvent(QDropEvent *event)
  2. {
  3. qDebug() << "enter in dropEvent";
  4. }
To copy to clipboard, switch view to plain text mode 

I cannot drop my item because I have the forbiden cursor, I never see the sentence "enter in dropEvent" but I have in output
dragEnterEvent text: "hello"
In addition, I have put in my QTableWidget constructor:
Qt Code:
  1. this->setAcceptDrops(true);
To copy to clipboard, switch view to plain text mode 

Any idea ...?