QmlJSEditor: Moving QmlOutlineModel to it's own class

This commit is contained in:
Kai Koehne
2010-07-12 09:44:42 +02:00
parent 223a1df854
commit ecf2a703e2
5 changed files with 279 additions and 253 deletions

View File

@@ -3,16 +3,9 @@
#include "qmljseditor.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/inavigationwidgetfactory.h>
#include <texteditor/ioutlinewidget.h>
#include <qmljs/parser/qmljsastvisitor_p.h>
#include <qmljs/qmljsdocument.h>
#include <qmljs/qmljsicons.h>
#include <QtGui/QStandardItemModel>
#include <QtGui/QTreeView>
#include <QtGui/QWidget>
namespace Core {
class IEditor;
@@ -25,35 +18,6 @@ class Editor;
namespace QmlJSEditor {
namespace Internal {
class QmlOutlineModel : public QStandardItemModel
{
Q_OBJECT
public:
enum CustomRoles {
SourceLocationRole = Qt::UserRole + 1
};
QmlOutlineModel(QObject *parent = 0);
void startSync();
QModelIndex enterElement(const QString &typeName, const QmlJS::AST::SourceLocation &location);
void leaveElement();
QModelIndex enterProperty(const QString &name, const QmlJS::AST::SourceLocation &location);
void leaveProperty();
private:
QStandardItem *enterNode(const QmlJS::AST::SourceLocation &location);
void leaveNode();
QStandardItem *parentItem();
QList<int> m_treePos;
QStandardItem *m_currentItem;
QmlJS::Icons m_icons;
};
class QmlJSOutlineTreeView : public QTreeView
{
Q_OBJECT
@@ -61,7 +25,6 @@ public:
QmlJSOutlineTreeView(QWidget *parent = 0);
};
class QmlJSOutlineWidget : public TextEditor::IOutlineWidget
{
Q_OBJECT
@@ -103,6 +66,4 @@ public:
} // namespace Internal
} // namespace QmlJSEditor
Q_DECLARE_METATYPE(QmlJS::AST::SourceLocation);
#endif // QMLJSOUTLINE_H