forked from qt-creator/qt-creator
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:
@@ -35,7 +35,7 @@
|
||||
#include <cplusplus/Scope.h>
|
||||
#include <cplusplus/Literals.h>
|
||||
#include <cplusplus/Symbols.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/dropsupport.h>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
@@ -258,12 +258,12 @@ Qt::DropActions OverviewModel::supportedDragActions() const
|
||||
|
||||
QStringList OverviewModel::mimeTypes() const
|
||||
{
|
||||
return Utils::FileDropSupport::mimeTypesForFilePaths();
|
||||
return Utils::DropSupport::mimeTypesForFilePaths();
|
||||
}
|
||||
|
||||
QMimeData *OverviewModel::mimeData(const QModelIndexList &indexes) const
|
||||
{
|
||||
auto mimeData = new Utils::FileDropMimeData;
|
||||
auto mimeData = new Utils::DropMimeData;
|
||||
foreach (const QModelIndex &index, indexes) {
|
||||
const QVariant fileName = data(index, FileNameRole);
|
||||
if (!fileName.canConvert<QString>())
|
||||
|
||||
Reference in New Issue
Block a user