MCPcopy Create free account
hub / github.com/KDE/kdiff3 / dropEvent

Method dropEvent

src/FileNameLineEdit.cpp:19–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <QUrl>
18
19void FileNameLineEdit::dropEvent(QDropEvent* event)
20{
21 assert(event->mimeData()->hasUrls());//Debugging aid in case FileNameLineEdit::dragEnterEvent is changed to accept other types.
22
23 qCDebug(kdiffMain) << "Enter FileNameLineEdit::dropEvent";
24 QList<QUrl> lst = event->mimeData()->urls();
25
26 if(lst.count() > 0)
27 {
28 /*
29 Do not use QUrl::toString() here. Sadly the Qt5 version does not permit Qt4 style
30 fullydecoded conversions. It also treats empty schemes as non-local.
31 */
32 qCDebug(kdiffMain) << "Received Drop Event";
33 qCDebug(kdiffMain) << "Url List Size: " << lst.count();
34 qCDebug(kdiffMain) << "lst[0] = " << lst[0];
35 setText(FileAccess::prettyAbsPath(lst[0]));
36 qCDebug(kdiffMain) << "Set line edit text to: " << text() ;
37 setFocus();
38 Q_EMIT returnPressed();
39 }
40 qCDebug(kdiffMain) << "Leave FileNameLineEdit::dropEvent";
41}
42
43void FileNameLineEdit::dragEnterEvent(QDragEnterEvent* e)
44{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected