QmlJSEditor: Use QmlOutline model also in combo box

The drop down combo box and the Outline in the sidebar now share
the same model.
This commit is contained in:
Kai Koehne
2010-07-12 14:45:22 +02:00
parent 9d803829eb
commit 94264617bf
6 changed files with 103 additions and 103 deletions

View File

@@ -35,6 +35,7 @@
#include <texteditor/basetexteditor.h>
#include <QtCore/QWaitCondition>
#include <QtCore/QModelIndex>
#include <QtCore/QMutex>
#include <QtCore/QThread>
@@ -58,6 +59,7 @@ class Highlighter;
namespace Internal {
class QmlJSTextEditor;
class QmlOutlineModel;
class QmlJSEditorEditable : public TextEditor::BaseTextEditorEditable
{
@@ -214,12 +216,15 @@ public:
int documentRevision() const;
bool isOutdated() const;
QmlOutlineModel *outlineModel() const;
QModelIndex outlineModelIndex() const;
public slots:
void followSymbolUnderCursor();
virtual void setFontSettings(const TextEditor::FontSettings &);
signals:
void semanticInfoUpdated(const QmlJSEditor::Internal::SemanticInfo &semanticInfo);
void outlineModelIndexChanged(const QModelIndex &index);
private slots:
void onDocumentUpdated(QmlJS::Document::Ptr doc);
@@ -266,6 +271,7 @@ private:
QString wordUnderCursor() const;
SemanticHighlighter::Source currentSource(bool force = false);
QModelIndex indexForPosition(unsigned cursorPosition, const QModelIndex &rootIndex = QModelIndex()) const;
const Core::Context m_context;
@@ -273,6 +279,8 @@ private:
QTimer *m_updateUsesTimer;
QTimer *m_semanticRehighlightTimer;
QComboBox *m_methodCombo;
QmlOutlineModel *m_outlineModel;
QModelIndex m_outlineModelIndex;
QmlJS::ModelManagerInterface *m_modelManager;
QTextCharFormat m_occurrencesFormat;
QTextCharFormat m_occurrencesUnusedFormat;