Commit 1e6bc275 authored by Eike Ziller's avatar Eike Ziller

QmlOutlineModel: Use document instead of widget

Change-Id: I56c4a1da84d00064334a235aec8f2710efdba365
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 9fcd43ed
......@@ -114,7 +114,7 @@ void QmlJSTextEditorWidget::ctor()
{
m_qmlJsEditorDocument = static_cast<QmlJSEditorDocument *>(baseTextDocument());
m_outlineCombo = 0;
m_outlineModel = new QmlOutlineModel(this);
m_outlineModel = new QmlOutlineModel(m_qmlJsEditorDocument);
m_contextPane = 0;
m_findReferences = new FindReferences(this);
......
......@@ -298,9 +298,9 @@ private:
int indent;
};
QmlOutlineModel::QmlOutlineModel(QmlJSTextEditorWidget *editor) :
QmlOutlineModel::QmlOutlineModel(QmlJSEditorDocument *editor) :
QStandardItemModel(editor),
m_textEditor(editor)
m_editorDocument(editor)
{
m_icons = Icons::instance();
const QString resourcePath = Core::ICore::resourcePath();
......@@ -401,7 +401,7 @@ Qt::ItemFlags QmlOutlineModel::flags(const QModelIndex &index) const
// only allow drag&drop if we're in sync
if (m_semanticInfo.isValid()
&& !m_textEditor->isSemanticInfoOutdated()) {
&& !m_editorDocument->isSemanticInfoOutdated()) {
if (index.parent().isValid())
flags |= Qt::ItemIsDragEnabled;
if (index.data(ItemTypeRole) != NonElementBindingType)
......
......@@ -30,7 +30,7 @@
#ifndef QMLOUTLINEMODEL_H
#define QMLOUTLINEMODEL_H
#include "qmljseditor.h"
#include "qmljseditordocument.h"
#include <utils/changeset.h>
#include <qmljs/qmljsdocument.h>
#include <qmljs/qmljsicons.h>
......@@ -81,7 +81,7 @@ public:
NonElementBindingType // can be filtered out
};
QmlOutlineModel(QmlJSTextEditorWidget *editor);
QmlOutlineModel(QmlJSEditorDocument *editor);
// QStandardItemModel
QStringList mimeTypes() const;
......@@ -159,7 +159,7 @@ private:
QHash<QmlOutlineItem*,QIcon> m_itemToIcon;
QHash<QmlOutlineItem*,QmlJS::AST::Node*> m_itemToNode;
QHash<QmlOutlineItem*,QmlJS::AST::UiQualifiedId*> m_itemToIdNode;
QmlJSTextEditorWidget *m_textEditor;
QmlJSEditorDocument *m_editorDocument;
friend class QmlOutlineModelSync;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment