void DragListWidget::dropEvent(QDropEvent *event){ if (event->mimeData()->hasUrls()) { foreach (QUrl url, event->mimeData()->urls()) { qDebug() << url; } } // пусто QString name = event->mimeData()->text(); qDebug() << name; // выводит "" QListWidget::dropEvent(event); }
this->objectName(); или простоobjectName();
QByteArray text = event->mimeData()->data("application/x-qabstractitemmodeldatalist"); QDataStream stream(&text, QIODevice::ReadOnly); while (!stream.atEnd()) { int row, col; QMap<int, QVariant> roleDataMap; stream >> row >> col >> roleDataMap; emit UpdateSignal(roleDataMap.first().toString(),bool(active),group_id); }