First step was:
Qt Code:
  1. MainWindow::MainWindow()
  2. {
  3. textEdit = new QTextEdit;
  4. setCentralWidget(textEdit);
  5.  
  6. textEdit->setAcceptDrops(false);
  7. setAcceptDrops(true);
  8.  
  9. setWindowTitle(tr("Text Editor"));
  10. }
  11.  
  12. void MainWindow::dragEnterEvent(QDragEnterEvent *event)
  13. {
  14. event->accept();
  15. }
  16.  
  17. void MainWindow::dragMoveEvent(QDragMoveEvent *event)
  18. {
  19. event->accept();
  20. }
  21.  
  22. void MainWindow::dropEvent(QDropEvent *event)
  23. {
  24. if (event->mimeData()->hasFormat("text/uri-list")) {
  25. QList<QUrl> urls = event->mimeData()->urls();
  26. if (urls.isEmpty())
  27. return;
  28.  
  29. QString fileName = urls.first().toLocalFile();
  30. if (fileName.isEmpty())
  31. return;
  32.  
  33. if (readFile(fileName))
  34. setWindowTitle(tr("%1 - %2").arg(fileName)
  35. .arg(tr("Drag File")));
  36. }
  37. }
To copy to clipboard, switch view to plain text mode 
In the second step I enabled drops for textEdit
Qt Code:
  1. textEdit->setAcceptDrops(true)
To copy to clipboard, switch view to plain text mode 
and subclassed it, so now it's possible to move/copy a text from a line to another:
Qt Code:
  1. ...dragEnterEvent(QDragEnterEvent *e)
  2. {
  3. if (e->source()) {
  4. if (e->source()->objectName() == "qt_scrollarea_viewport") {
  5. e->accept();
  6. }
  7. }
  8. }
  9.  
  10. ...dragMoveEvent(QDragMoveEvent *e)
  11. {
  12. e->accept();
  13. }
To copy to clipboard, switch view to plain text mode 
My questions:
1. During drag the cursor stays hidden: is this due to the non-propagation of the event to the parent?
2. Why subclassing dropEvent() like this
Qt Code:
  1. ...dropEvent(QDropEvent *e)
  2. {
  3. e->accept();
  4. }
To copy to clipboard, switch view to plain text mode 
text is not copied/moved?
3. Are there any alternatives to get this task?
I hope this thread will be useful for others.
Thank you so much.