MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / dropEvent

Method dropEvent

bt_editor/editor_flowscene.cpp:113–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112
113void EditorFlowScene::dropEvent(QGraphicsSceneDragDropEvent *event)
114{
115 if(!_editor_locked && event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist") )
116 {
117 QByteArray encoded = event->mimeData()->data("application/x-qabstractitemmodeldatalist");
118 QDataStream stream(&encoded, QIODevice::ReadOnly);
119 QPointF scene_pos = event->scenePos();
120
121 while (!stream.atEnd())
122 {
123 int row, col;
124 QMap<int, QVariant> roleDataMap;
125 stream >> row >> col >> roleDataMap;
126
127 auto it = roleDataMap.find(0);
128 if (it != roleDataMap.end() )
129 {
130 const auto& ID = it.value().toString();
131 createNodeAtPos( ID, ID, scene_pos);
132 }
133 }
134 }
135 event->acceptProposedAction();
136}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected