QmlOutline: Don't allow drag&drop when outline is out of sync

The Outline is only updated (with a delay) if the current text is syntactically valid.
Prevent the outline from changing the text underneath via drag&drop if
the outline model is 'behind'.

Reviewed-by: Christian Kamm
This commit is contained in:
Kai Koehne
2010-10-07 15:25:05 +02:00
parent d1175f3ea2
commit 87ed874600
2 changed files with 25 additions and 6 deletions

View File

@@ -55,12 +55,13 @@ public:
NonElementBindingType // can be filtered out
};
QmlOutlineModel(QObject *parent = 0);
QmlOutlineModel(QmlJSTextEditor *editor);
// QStandardItemModel
QStringList mimeTypes() const;
QMimeData *mimeData(const QModelIndexList &indexes) const;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
Qt::ItemFlags flags(const QModelIndex &index) const;
QmlJS::Document::Ptr document() const;
void update(const SemanticInfo &semanticInfo);
@@ -124,6 +125,7 @@ private:
QHash<QmlOutlineItem*,QIcon> m_itemToIcon;
QHash<QmlOutlineItem*,QmlJS::AST::Node*> m_itemToNode;
QHash<QmlOutlineItem*,QmlJS::AST::UiQualifiedId*> m_itemToIdNode;
QmlJSTextEditor *m_textEditor;
friend class QmlOutlineModelSync;