forked from qt-creator/qt-creator
TextEditor: Merge the two sets of *EditorWidget constructors
Change-Id: I45d87d0be722ac36d64af222f03f8cb76242c9df Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -175,20 +175,10 @@ CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
|
||||
{
|
||||
}
|
||||
|
||||
CppEditorWidget::CppEditorWidget(QWidget *parent)
|
||||
: TextEditor::BaseTextEditorWidget(new CPPEditorDocument(), parent)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
CppEditorWidget::CppEditorWidget(CppEditorWidget *other)
|
||||
: TextEditor::BaseTextEditorWidget(other)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void CppEditorWidget::ctor()
|
||||
CppEditorWidget::CppEditorWidget(TextEditor::BaseTextDocumentPtr doc)
|
||||
: TextEditor::BaseTextEditorWidget(0)
|
||||
{
|
||||
setTextDocument(doc);
|
||||
d.reset(new CppEditorWidgetPrivate(this));
|
||||
|
||||
qRegisterMetaType<SemanticInfo>("CppTools::SemanticInfo");
|
||||
@@ -781,8 +771,7 @@ void CppEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
|
||||
Core::IEditor *CPPEditor::duplicate()
|
||||
{
|
||||
CppEditorWidget *newEditor = new CppEditorWidget(
|
||||
qobject_cast<CppEditorWidget *>(editorWidget()));
|
||||
CppEditorWidget *newEditor = new CppEditorWidget(editorWidget()->textDocumentPtr());
|
||||
CppEditorPlugin::instance()->initializeEditor(newEditor);
|
||||
return newEditor->editor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user