Hi All,

I am trying to Drag from a QListWidget and drop it into QTextBrower/ QLineEdit.

I am trying to copy "Text/plain" to the mimedata by doing this:

Qt Code:
  1. void MainWindow::dragEnterEvent(QDragEnterEvent *Event)
  2. {
  3. QString my_text;
  4. QDrag *drag = new QDrag(this);
  5. QMimeData *mimeData = new QMimeData;
  6. my_text = Event->mimeData()->text();
  7. mimeData->setText(my_text);
  8. drag->setMimeData(mimeData);
  9. drag->exec();
  10. }
To copy to clipboard, switch view to plain text mode 

But in the dropEvent function, when i capture the mimedata, it is of "application/x-qabstractitemmodeldatalist" format.

Qt Code:
  1. void MainWindow::dropEvent(QDropEvent *Event)
  2. {
  3. QString my_text;
  4. QStringList myformats = Event->mimeData()->formats();
  5. foreach(QString format, myformats)
  6. qDebug() << format;
  7.  
  8. qDebug() << my_text;
  9. Event->acceptProposedAction();
  10. }
To copy to clipboard, switch view to plain text mode 


Kindly help me in dropping the mimedata to QLineEdit or QTextBrowser.

Thanks