MCPcopy Create free account
hub / github.com/KDE/labplot / processDropEvent

Method processDropEvent

src/backend/core/Folder.cpp:89–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void 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

Callers 2

eventFilterMethod · 0.45
dropEventMethod · 0.45

Calls 2

reparentMethod · 0.45
setSelectedMethod · 0.45

Tested by

no test coverage detected