forked from qt-creator/qt-creator
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 sortedOutline). Change-Id: Ie595fb19d58be1c4339498a2dce9b97097867490 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
\internal
|
||||
|
||||
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;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace CPlusPlus { class OverviewModel; }
|
||||
namespace TextEditor { class TextEditorWidget; }
|
||||
namespace Utils { class TreeViewComboBox; }
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CppEditorWidget;
|
||||
|
||||
class CppEditorOutline : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(CppEditorOutline)
|
||||
|
||||
public:
|
||||
explicit CppEditorOutline(CppEditorWidget *editorWidget);
|
||||
explicit CppEditorOutline(TextEditor::TextEditorWidget *editorWidget);
|
||||
|
||||
void update();
|
||||
|
||||
@@ -84,7 +83,7 @@ private:
|
||||
const QModelIndex &rootIndex = QModelIndex()) const;
|
||||
|
||||
private:
|
||||
CppEditorWidget *m_editorWidget;
|
||||
TextEditor::TextEditorWidget *m_editorWidget;
|
||||
|
||||
Utils::TreeViewComboBox *m_combo; // Not owned
|
||||
CPlusPlus::OverviewModel *m_model;
|
||||
|
Reference in New Issue
Block a user