MCPcopy Create free account
hub / github.com/MITK/MITK / mimeData

Method mimeData

Modules/QtWidgets/src/QmitkRenderWindowDataStorageTreeModel.cpp:300–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300QMimeData* 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
320bool QmitkRenderWindowDataStorageTreeModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int /*row*/, int /*column*/, const QModelIndex& parent)
321{

Callers

nothing calls this directly

Calls 1

setDataMethod · 0.45

Tested by

no test coverage detected