Hi All

Already i have posted this query in forum ..

My problem is TreeWidget Drag and drop..

I have seen in forum ,some one faced same issue ,what i am facing

How do i write the DropEvent function for accepting drops only TopLevelIems

My code look like
Qt Code:
  1. ui->treeWidget->setDragEnabled(true);
  2. ui->treeWidget->setAcceptDrops(true);
  3. ui->treeWidget->setDragDropMode(QAbstractItemView ::InternalMove);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. void MainWindow::dragEnterEvent(QDragEnterEvent *eve)
  2. {
  3. qDebug() << "Drag enter event";
  4.  
  5. eve->accept();
  6.  
  7. }
  8. void MainWindow::dragMoveEvent(QDragMoveEvent *e)
  9. {
  10. qDebug() << "Drag move event";
  11. e->accept();
  12. }
  13. void MainWindow::dropEvent(QDropEvent *event)
  14. {
  15.  
  16. // QMessageBox::information(0,"",QString("Drop event"));
  17. qDebug() << "Drop function called";
  18.  
  19. }
To copy to clipboard, switch view to plain text mode 

Please help to sort out this problem


Advance thanks for your helping


Thanks

Yuvaraj R