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:
Thomas Hartmann
2017-05-11 13:32:41 +02:00
parent 8f0c5397e6
commit 33c6ffc6ee
2 changed files with 0 additions and 44 deletions

View File

@@ -36,7 +36,6 @@
#include <abstractview.h> #include <abstractview.h>
#include <invalididexception.h> #include <invalididexception.h>
#include <rewritingexception.h> #include <rewritingexception.h>
#include <modelnodecontextmenu.h>
#include <qmlitemnode.h> #include <qmlitemnode.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -411,33 +410,6 @@ QModelIndex NavigatorTreeModel::createIndexFromModelNode(int row, int column, co
return index; 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, bool NavigatorTreeModel::dropMimeData(const QMimeData *mimeData,
Qt::DropAction action, Qt::DropAction action,
int rowNumber, int rowNumber,
@@ -670,15 +642,4 @@ void NavigatorTreeModel::notifyModelNodesMoved(const QList<ModelNode> &modelNode
layoutChanged(indexes); 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 } // QmlDesigner

View File

@@ -78,9 +78,6 @@ public:
QModelIndex createIndexFromModelNode(int row, int column, const ModelNode &modelNode) const; 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 supportedDropActions() const override;
Qt::DropActions supportedDragActions() const override; Qt::DropActions supportedDragActions() const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) 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 notifyModelNodesRemoved(const QList<ModelNode> &modelNodes);
void notifyModelNodesInserted(const QList<ModelNode> &modelNodes); void notifyModelNodesInserted(const QList<ModelNode> &modelNodes);
void notifyModelNodesMoved(const QList<ModelNode> &modelNodes); void notifyModelNodesMoved(const QList<ModelNode> &modelNodes);
bool isNodeVisible(const QModelIndex &index) const;
bool hasError(const QModelIndex &index) const;
private: private:
void moveNodesInteractive(NodeAbstractProperty &parentProperty, const QList<ModelNode> &modelNodes, int targetIndex); void moveNodesInteractive(NodeAbstractProperty &parentProperty, const QList<ModelNode> &modelNodes, int targetIndex);