forked from qt-creator/qt-creator
QmlDesigner: Remove dead code from NavigatorTreeModel
This code has been moved to the delegates. Change-Id: I3e44a3eb2038299d3b0a7de1e86ed92c3d835bd4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#include <abstractview.h>
|
||||
#include <invalididexception.h>
|
||||
#include <rewritingexception.h>
|
||||
#include <modelnodecontextmenu.h>
|
||||
#include <qmlitemnode.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -411,33 +410,6 @@ QModelIndex NavigatorTreeModel::createIndexFromModelNode(int row, int column, co
|
||||
return index;
|
||||
}
|
||||
|
||||
void NavigatorTreeModel::setId(const QModelIndex &index, const QString &newId)
|
||||
{
|
||||
ModelNode modelNode = modelNodeForIndex(index);
|
||||
|
||||
if (!modelNode.isValid())
|
||||
return;
|
||||
|
||||
if (modelNode.id() == newId)
|
||||
return;
|
||||
|
||||
if (!modelNode.isValidId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId));
|
||||
} else if (modelNode.view()->hasId(newId)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 already exists.").arg(newId));
|
||||
} else {
|
||||
modelNode.setIdWithRefactoring(newId);
|
||||
}
|
||||
}
|
||||
|
||||
void NavigatorTreeModel::openContextMenu(const QPoint &position)
|
||||
{
|
||||
QTC_ASSERT(m_view, return);
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
ModelNodeContextMenu::showContextMenu(m_view.data(), position, QPoint(), false);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NavigatorTreeModel::dropMimeData(const QMimeData *mimeData,
|
||||
Qt::DropAction action,
|
||||
int rowNumber,
|
||||
@@ -670,15 +642,4 @@ void NavigatorTreeModel::notifyModelNodesMoved(const QList<ModelNode> &modelNode
|
||||
layoutChanged(indexes);
|
||||
}
|
||||
|
||||
bool NavigatorTreeModel::isNodeVisible(const QModelIndex &index) const
|
||||
{
|
||||
return m_view->isNodeVisible(modelNodeForIndex(index));
|
||||
}
|
||||
|
||||
bool NavigatorTreeModel::hasError(const QModelIndex &index) const
|
||||
{
|
||||
return QmlObjectNode(modelNodeForIndex(index)).hasError();
|
||||
}
|
||||
|
||||
|
||||
} // QmlDesigner
|
||||
|
||||
@@ -78,9 +78,6 @@ public:
|
||||
|
||||
QModelIndex createIndexFromModelNode(int row, int column, const ModelNode &modelNode) const;
|
||||
|
||||
void setId(const QModelIndex &index, const QString &newId);
|
||||
void openContextMenu(const QPoint &position);
|
||||
|
||||
Qt::DropActions supportedDropActions() const override;
|
||||
Qt::DropActions supportedDragActions() const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
@@ -89,8 +86,6 @@ public:
|
||||
void notifyModelNodesRemoved(const QList<ModelNode> &modelNodes);
|
||||
void notifyModelNodesInserted(const QList<ModelNode> &modelNodes);
|
||||
void notifyModelNodesMoved(const QList<ModelNode> &modelNodes);
|
||||
bool isNodeVisible(const QModelIndex &index) const;
|
||||
bool hasError(const QModelIndex &index) const;
|
||||
|
||||
private:
|
||||
void moveNodesInteractive(NodeAbstractProperty &parentProperty, const QList<ModelNode> &modelNodes, int targetIndex);
|
||||
|
||||
Reference in New Issue
Block a user