| 111 | |
| 112 | |
| 113 | void 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected