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:
@@ -34,7 +34,7 @@
|
||||
#include "classviewutils.h"
|
||||
|
||||
#include <cplusplus/Icons.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/dropsupport.h>
|
||||
|
||||
namespace ClassView {
|
||||
namespace Internal {
|
||||
@@ -141,12 +141,12 @@ Qt::DropActions TreeItemModel::supportedDragActions() const
|
||||
|
||||
QStringList TreeItemModel::mimeTypes() const
|
||||
{
|
||||
return ::Utils::FileDropSupport::mimeTypesForFilePaths();
|
||||
return ::Utils::DropSupport::mimeTypesForFilePaths();
|
||||
}
|
||||
|
||||
QMimeData *TreeItemModel::mimeData(const QModelIndexList &indexes) const
|
||||
{
|
||||
auto mimeData = new ::Utils::FileDropMimeData;
|
||||
auto mimeData = new ::Utils::DropMimeData;
|
||||
mimeData->setOverrideFileDropAction(Qt::CopyAction);
|
||||
foreach (const QModelIndex &index, indexes) {
|
||||
const QSet<SymbolLocation> locations = Utils::roleToLocations(
|
||||
|
||||
Reference in New Issue
Block a user