Editors: Support dragging from outline views

Fill the line and column information in the location returned by
QmlOutlineModel::sourceLocation for that.
The drag & drop code also needed a way to override the executed drop
action for file drops, because the QML outline supports move-drags, which
would lead to the items being removed from the outline when dragged onto
a split...

Change-Id: I2478abc7d5aa2f3aa676cdd609ecb69a50adce8c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Eike Ziller
2014-09-29 14:41:42 +02:00
parent 92c4f26e99
commit 81cb471997
9 changed files with 119 additions and 14 deletions

View File

@@ -236,11 +236,19 @@ class QTCREATOR_UTILS_EXPORT FileDropMimeData : public QMimeData
{
Q_OBJECT
public:
FileDropMimeData();
void setOverrideFileDropAction(Qt::DropAction action);
Qt::DropAction overrideFileDropAction() const;
bool isOverridingFileDropAction() const;
void addFile(const QString &filePath, int line = -1, int column = -1);
QList<FileDropSupport::FileSpec> files() const;
private:
QList<FileDropSupport::FileSpec> m_files;
Qt::DropAction m_overrideDropAction;
bool m_isOverridingDropAction;
};
} // namespace Utils