| 298 | } |
| 299 | |
| 300 | QMimeData* QmitkRenderWindowDataStorageTreeModel::mimeData(const QModelIndexList& indexes) const |
| 301 | { |
| 302 | QMimeData* mimeData = new QMimeData(); |
| 303 | QByteArray encodedData; |
| 304 | |
| 305 | QDataStream stream(&encodedData, QIODevice::WriteOnly); |
| 306 | |
| 307 | for (const auto& index : indexes) |
| 308 | { |
| 309 | if (index.isValid()) |
| 310 | { |
| 311 | auto dataNode = data(index, QmitkDataNodeRawPointerRole).value<mitk::DataNode*>(); |
| 312 | stream << reinterpret_cast<quintptr>(dataNode); |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | mimeData->setData(QmitkMimeTypes::DataNodePtrs, encodedData); |
| 317 | return mimeData; |
| 318 | } |
| 319 | |
| 320 | bool QmitkRenderWindowDataStorageTreeModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int /*row*/, int /*column*/, const QModelIndex& parent) |
| 321 | { |