MCPcopy Create free account
hub / github.com/aldelaro5/dolphin-memory-engine / mimeData

Method mimeData

Source/GUI/StructEditor/StructSelectModel.cpp:193–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193QMimeData* StructSelectModel::mimeData(const QModelIndexList& indexes) const
194{
195 QMimeData* mimeData = new QMimeData;
196 QByteArray data;
197
198 QDataStream stream(&data, QIODevice::WriteOnly);
199 QList<StructTreeNode*> nodes;
200
201 foreach (const QModelIndex& index, indexes)
202 {
203 StructTreeNode* node = static_cast<StructTreeNode*>(index.internalPointer());
204 if (!nodes.contains(node))
205 nodes << node;
206 }
207 StructTreeNode* leastDeepNode = getLeastDeepNodeFromList(nodes);
208 const qulonglong leastDeepPointer{Common::bit_cast<qulonglong, StructTreeNode*>(leastDeepNode)};
209 stream << leastDeepPointer;
210 stream << static_cast<int>(nodes.count());
211 foreach (StructTreeNode* node, nodes)
212 {
213 const auto pointer{Common::bit_cast<qulonglong, StructTreeNode*>(node)};
214 stream << pointer;
215 }
216 mimeData->setData("application/x-structtreenode", data);
217 return mimeData;
218}
219
220StructTreeNode*
221StructSelectModel::getLeastDeepNodeFromList(const QList<StructTreeNode*>& nodes) const

Callers

nothing calls this directly

Calls 1

setDataMethod · 0.45

Tested by

no test coverage detected