diff options
author | David Schulz <david.schulz@qt.io> | 2022-08-15 13:06:12 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2022-08-18 06:20:10 +0000 |
commit | 5b3b1a60a1902762ad1788dbd20a21348da4e822 (patch) | |
tree | 08cb62f5280be750c7ef206ff81bf377650ca7bc /src/plugins/cppeditor/cppeditoroutline.h | |
parent | 4a796239594f905644b3459ff93b804d473aa443 (diff) |
CppEditor: move outline model to document
This way we only have one model per document instead of one per editor.
Additionally we further separate the outline views (combobox and side
pane) from the actual model.
Change-Id: I9705716b5c9f8f19f75708ec73d7c3b3c5de586f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppeditoroutline.h')
-rw-r--r-- | src/plugins/cppeditor/cppeditoroutline.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/plugins/cppeditor/cppeditoroutline.h b/src/plugins/cppeditor/cppeditoroutline.h index 59870bb656..d1461075d3 100644 --- a/src/plugins/cppeditor/cppeditoroutline.h +++ b/src/plugins/cppeditor/cppeditoroutline.h @@ -41,18 +41,18 @@ QT_END_NAMESPACE namespace TextEditor { class TextEditorWidget; } namespace Utils { class TreeViewComboBox; } -namespace CppEditor::Internal { +namespace CppEditor { +class CppEditorWidget; + +namespace Internal { class CppEditorOutline : public QObject { Q_OBJECT public: - explicit CppEditorOutline(TextEditor::TextEditorWidget *editorWidget); - - void update(); + explicit CppEditorOutline(CppEditorWidget *editorWidget); - OverviewModel *model() const; QModelIndex modelIndex(); QWidget *widget() const; // Must be deleted by client. @@ -75,18 +75,16 @@ private: QModelIndex indexForPosition(int line, int column, const QModelIndex &rootIndex = QModelIndex()) const; -private: - QSharedPointer<CPlusPlus::Document> m_document; - std::unique_ptr<OverviewModel> m_model; + OverviewModel *m_model = nullptr; // Not owned - TextEditor::TextEditorWidget *m_editorWidget; + CppEditorWidget *m_editorWidget = nullptr; - Utils::TreeViewComboBox *m_combo; // Not owned - QSortFilterProxyModel *m_proxyModel; + Utils::TreeViewComboBox *m_combo = nullptr; // Not owned + QSortFilterProxyModel *m_proxyModel = nullptr; QModelIndex m_modelIndex; - QAction *m_sortAction; - QTimer *m_updateTimer; - QTimer *m_updateIndexTimer; + QAction *m_sortAction = nullptr; + QTimer *m_updateIndexTimer = nullptr; }; -} // namespace CppEditor::Internal +} // namespace Internal +} // namespace CppEditor |