Commit db57fa89 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

CppEditor: Make CppEditorOutline independent of CppEditorWidget

This enables us to move CppEditorOutline easier to CppTools, from where
it could be subclassed by the ClangCodeModel plugin.

Note that there is still the dependency to cppeditorplugin.h (setting

Change-Id: Ie595fb19d58be1c4339498a2dce9b97097867490
Reviewed-by: default avatarMarco Bubke <>
parent cfd3b561
......@@ -30,11 +30,11 @@
#include "cppeditoroutline.h"
#include "cppeditor.h"
#include "cppeditorplugin.h"
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsreuse.h>
#include <texteditor/texteditor.h>
#include <cplusplus/OverviewModel.h>
#include <utils/treeviewcombobox.h>
......@@ -44,14 +44,12 @@
\class CppEditor::Internal::CppEditorOutline
\brief A helper class of CppEditorWidget that provides the outline model
and widget, e.g. for the editor's tool bar.
\brief A helper class that provides the outline model and widget,
e.g. for the editor's tool bar.
The caller is responsible for deleting the widget returned by widget().
\sa CppEditor::Internal::CppEditorWidget
enum { UpdateOutlineIntervalInMs = 500 };
......@@ -98,7 +96,7 @@ QTimer *newSingleShotTimer(QObject *parent, int msInternal, const QString &objec
namespace CppEditor {
namespace Internal {
CppEditorOutline::CppEditorOutline(CppEditorWidget *editorWidget)
CppEditorOutline::CppEditorOutline(TextEditor::TextEditorWidget *editorWidget)
: QObject(editorWidget)
, m_editorWidget(editorWidget)
, m_combo(new Utils::TreeViewComboBox)
......@@ -41,20 +41,19 @@ class QTimer;
namespace CPlusPlus { class OverviewModel; }
namespace TextEditor { class TextEditorWidget; }
namespace Utils { class TreeViewComboBox; }
namespace CppEditor {
namespace Internal {
class CppEditorWidget;
class CppEditorOutline : public QObject
explicit CppEditorOutline(CppEditorWidget *editorWidget);
explicit CppEditorOutline(TextEditor::TextEditorWidget *editorWidget);
void update();
......@@ -84,7 +83,7 @@ private:
const QModelIndex &rootIndex = QModelIndex()) const;
CppEditorWidget *m_editorWidget;
TextEditor::TextEditorWidget *m_editorWidget;
Utils::TreeViewComboBox *m_combo; // Not owned
CPlusPlus::OverviewModel *m_model;
Supports Markdown
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