Hello,

I'm relatively new to Qt and I have problems to implement drag&drop function to my derived QListWidget class. While the drag is working perfectly, the drop does't. The cursor changes to "forbidden" after dragging an Item.
For now, I just want to get the x-Axis position of the drag and drop point (Drag is working).

Derived class:

.h:
Qt Code:
  1. class myQListWidget:public QListWidget
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. myQListWidget(QWidget * parent = 0);
  7. ~myQListWidget();
  8.  
  9. protected:
  10. void dropEvent(QDropEvent *event);
  11. void dragEnterEvent(QDragEnterEvent *event);
  12.  
  13. };
To copy to clipboard, switch view to plain text mode 

.cpp:
Qt Code:
  1. myQListWidget::myQListWidget(QWidget * parent)
  2. {
  3.  
  4. this->setAcceptDrops(true);
  5. this->setDragDropMode(QAbstractItemView::DragDrop);
  6.  
  7. }
  8.  
  9. myQListWidget::~myQListWidget()
  10. {
  11.  
  12. }
  13.  
  14. void myQListWidget::dropEvent(QDropEvent *event)
  15. {
  16. xPositionDrop = event->pos().rx();
  17. qDebug() << "xPositionDrop: " << xPositionDrag;
  18. }
  19.  
  20. void myQListWidget::dragEnterEvent(QDragEnterEvent *event)
  21. {
  22. xPositionDrag = event->pos().rx();
  23. qDebug() << "xPositionDrag: " << xPositionDrag;
  24. }
To copy to clipboard, switch view to plain text mode 

When using the original QListWidget class, the cursor does not change to "forbidden" and drops work properly.
What am I missing here?

Thanks.