Introduce dragging for all explorer nodes.

Extend drop support with variant values. A drop may be a file drop or a
value drop or both.

Rename Utils::FileDropSupport to Utils::DropSupport and add methods to
add not only files but any QVariant value to the mime data. Project
explorer adds dragged nodes (which will be needed for future ModelEditor
plugin).

Change-Id: I799542c60fdecb3e64af0d3ba47b6caa9adbcfd7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Jochen Becher
2015-06-04 12:35:59 +02:00
parent d311877142
commit 431b25ad27
23 changed files with 406 additions and 250 deletions

View File

@@ -79,6 +79,7 @@
#include <coreplugin/find/basetextfind.h>
#include <utils/linecolumnlabel.h>
#include <utils/fileutils.h>
#include <utils/dropsupport.h>
#include <utils/hostosinfo.h>
#include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcassert.h>
@@ -7319,7 +7320,7 @@ void TextEditorLinkLabel::mouseMoveEvent(QMouseEvent *event)
if ((event->pos() - m_dragStartPosition).manhattanLength() < QApplication::startDragDistance())
return;
auto data = new FileDropMimeData;
auto data = new DropMimeData;
data->addFile(m_link.targetFileName, m_link.targetLine, m_link.targetColumn);
auto drag = new QDrag(this);
drag->setMimeData(data);