MCPcopy Create free account
hub / github.com/YACReader/yacreader / dropEvent

Method dropEvent

YACReaderLibrary/comics_view.cpp:99–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void ComicsView::dropEvent(QDropEvent *event)
100{
101 QLOG_DEBUG() << "drop" << event->dropAction();
102
103 bool validAction = event->dropAction() == Qt::CopyAction; // || event->dropAction() & Qt::MoveAction; TODO move
104
105 if (event->mimeData()->hasUrls() && validAction) {
106
107 QList<QPair<QString, QString>> droppedFiles = ComicFilesManager::getDroppedFiles(event->mimeData()->urls());
108
109 if (event->dropAction() == Qt::CopyAction) {
110 QLOG_DEBUG() << "copy :" << droppedFiles;
111 emit copyComicsToCurrentFolder(droppedFiles);
112 } else if (event->dropAction() & Qt::MoveAction) {
113 QLOG_DEBUG() << "move :" << droppedFiles;
114 emit moveComicsToCurrentFolder(droppedFiles);
115 }
116
117 event->acceptProposedAction();
118 }
119}

Callers

nothing calls this directly

Calls 1

mimeDataMethod · 0.45

Tested by

no test coverage detected