forked from qt-creator/qt-creator
QmlJSEditor: Moving QmlOutlineModel to it's own class
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user