QDrag *drag = new QDrag(this); QString text = QString("TEXT"); QMimeData *mimeData = new QMimeData(); mimeData->setText(text); drag->setMimeData(mimeData); Qt::DropAction dropAction = drag->exec(Qt::CopyAction|Qt::MoveAction);