| 87 | } |
| 88 | |
| 89 | void Folder::processDropEvent(const QVector<quintptr>& vec) { |
| 90 | // reparent AbstractPart and Folder objects only |
| 91 | AbstractAspect* lastMovedAspect{nullptr}; |
| 92 | for (auto a : vec) { |
| 93 | auto* aspect = reinterpret_cast<AbstractAspect*>(a); |
| 94 | auto* part = dynamic_cast<AbstractPart*>(aspect); |
| 95 | if (part) { |
| 96 | part->reparent(this); |
| 97 | lastMovedAspect = part; |
| 98 | } else { |
| 99 | auto* folder = dynamic_cast<Folder*>(aspect); |
| 100 | if (folder && folder != this) { |
| 101 | folder->reparent(this); |
| 102 | lastMovedAspect = folder; |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // select the last moved aspect in the project explorer |
| 108 | if (lastMovedAspect) |
| 109 | lastMovedAspect->setSelected(true); |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * \brief Save as XML |
no test coverage detected