diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 805b865adb1..760c4d32a04 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -66,9 +66,8 @@ CMakeEditor::CMakeEditor(CMakeEditorWidget *editor) Core::IEditor *CMakeEditor::duplicate() { - CMakeEditorWidget *w = qobject_cast(widget()); - CMakeEditorWidget *ret = new CMakeEditorWidget(); - ret->duplicateFrom(w); + CMakeEditorWidget *ret = new CMakeEditorWidget( + qobject_cast(editorWidget())); TextEditor::TextEditorSettings::initializeEditor(ret); return ret->editor(); } @@ -118,8 +117,18 @@ void CMakeEditor::build() CMakeEditorWidget::CMakeEditorWidget(QWidget *parent) : BaseTextEditorWidget(new CMakeDocument(), parent) { - baseTextDocument()->setSyntaxHighlighter(new CMakeHighlighter); + ctor(); +} +CMakeEditorWidget::CMakeEditorWidget(CMakeEditorWidget *other) + : BaseTextEditorWidget(other) +{ + ctor(); +} + +void CMakeEditorWidget::ctor() +{ + baseTextDocument()->setSyntaxHighlighter(new CMakeHighlighter); m_commentDefinition.clearCommentStyles(); m_commentDefinition.singleLine = QLatin1Char('#'); } diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h index 2dfe50b9d04..dffc1e95d8c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.h +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h @@ -70,6 +70,7 @@ class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget public: CMakeEditorWidget(QWidget *parent = 0); + CMakeEditorWidget(CMakeEditorWidget *other); bool save(const QString &fileName = QString()); @@ -83,6 +84,8 @@ public slots: void unCommentSelection(); private: + CMakeEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity + void ctor(); Utils::CommentDefinition m_commentDefinition; }; diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 850e4bce64a..f7c2ab987e1 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -513,15 +513,27 @@ Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder) CPPEditorWidget::CPPEditorWidget(QWidget *parent) : TextEditor::BaseTextEditorWidget(parent) - , m_currentRenameSelection(NoCurrentRenameSelection) - , m_inRename(false) - , m_inRenameChanged(false) - , m_firstRenameChange(false) - , m_objcEnabled(false) - , m_commentsSettings(CppTools::CppToolsSettings::instance()->commentsSettings()) - , m_followSymbolUnderCursor(new FollowSymbolUnderCursor(this)) - , m_preprocessorButton(0) { + ctor(); +} + +CPPEditorWidget::CPPEditorWidget(CPPEditorWidget *other) + : TextEditor::BaseTextEditorWidget(other) +{ + ctor(); +} + +void CPPEditorWidget::ctor() +{ + m_currentRenameSelection = NoCurrentRenameSelection; + m_inRename = false; + m_inRenameChanged = false; + m_firstRenameChange = false; + m_objcEnabled = false; + m_commentsSettings = CppTools::CppToolsSettings::instance()->commentsSettings(); + m_followSymbolUnderCursor.reset(new FollowSymbolUnderCursor(this)); + m_preprocessorButton = 0; + qRegisterMetaType("CppTools::SemanticInfo"); setParenthesesMatchingEnabled(true); @@ -640,7 +652,8 @@ void CPPEditorWidget::createToolBar(CPPEditor *editor) connect(m_outlineCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateOutlineToolTip())); // set up slots to document changes - updateContentsChangedSignal(); + connect(document(), SIGNAL(contentsChange(int,int,int)), + this, SLOT(onContentsChanged(int,int,int))); // set up function declaration - definition link connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateFunctionDeclDefLink())); @@ -1501,10 +1514,8 @@ void CPPEditorWidget::keyPressEvent(QKeyEvent *e) Core::IEditor *CPPEditor::duplicate() { - CPPEditorWidget *newEditor = new CPPEditorWidget(); - newEditor->duplicateFrom(editorWidget()); - // A new QTextDocument was set, so update our signal/slot connection to the new document - newEditor->updateContentsChangedSignal(); + CPPEditorWidget *newEditor = new CPPEditorWidget( + qobject_cast(editorWidget())); CppEditorPlugin::instance()->initializeEditor(newEditor); return newEditor->editor(); } @@ -1860,12 +1871,6 @@ void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch) updateFunctionDeclDefLink(); } -void CPPEditorWidget::updateContentsChangedSignal() -{ - connect(document(), SIGNAL(contentsChange(int,int,int)), - this, SLOT(onContentsChanged(int,int,int))); -} - FollowSymbolUnderCursor *CPPEditorWidget::followSymbolUnderCursorDelegate() { return m_followSymbolUnderCursor.data(); diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 7a08c6c1a91..057f9784234 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -98,6 +98,7 @@ public: typedef TextEditor::TabSettings TabSettings; CPPEditorWidget(QWidget *parent = 0); + CPPEditorWidget(CPPEditorWidget *other); ~CPPEditorWidget(); void unCommentSelection(); @@ -130,8 +131,6 @@ public: QSharedPointer declDefLink() const; void applyDeclDefLinkChanges(bool jumpToMatch); - void updateContentsChangedSignal(); - FollowSymbolUnderCursor *followSymbolUnderCursorDelegate(); // exposed for tests Q_SIGNALS: @@ -191,6 +190,8 @@ private Q_SLOTS: void onCommentsSettingsChanged(const CppTools::CommentsSettings &settings); private: + CPPEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity + void ctor(); void markSymbols(const QTextCursor &tc, const CppTools::SemanticInfo &info); bool sortedOutline() const; diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp index 6ef0c59eb0d..958b6c40635 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp @@ -93,9 +93,8 @@ bool ProjectFilesEditor::duplicateSupported() const Core::IEditor *ProjectFilesEditor::duplicate() { - ProjectFilesEditorWidget *parentEditor = qobject_cast(editorWidget()); - ProjectFilesEditorWidget *editor = new ProjectFilesEditorWidget(); - editor->duplicateFrom(parentEditor); + ProjectFilesEditorWidget *editor = new ProjectFilesEditorWidget( + qobject_cast(editorWidget())); TextEditorSettings::initializeEditor(editor); return editor->editor(); } @@ -111,6 +110,11 @@ ProjectFilesEditorWidget::ProjectFilesEditorWidget(QWidget *parent) { } +ProjectFilesEditorWidget::ProjectFilesEditorWidget(ProjectFilesEditorWidget *other) + : BaseTextEditorWidget(other) +{ +} + BaseTextEditor *ProjectFilesEditorWidget::createEditor() { return new ProjectFilesEditor(this); diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.h b/src/plugins/genericprojectmanager/genericprojectfileseditor.h index c81b87a4659..1236a8a9241 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.h +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.h @@ -70,8 +70,12 @@ class ProjectFilesEditorWidget : public TextEditor::BaseTextEditorWidget public: ProjectFilesEditorWidget(QWidget *parent = 0); + ProjectFilesEditorWidget(ProjectFilesEditorWidget *other); TextEditor::BaseTextEditor *createEditor(); + +private: + ProjectFilesEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity }; } // namespace Internal diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 471da951580..0aca114e5fa 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -140,10 +140,21 @@ void Document::addRange(const QTextCursor &cursor, GLSL::Scope *scope) _cursors.append(c); } -GLSLTextEditorWidget::GLSLTextEditorWidget(QWidget *parent) : - TextEditor::BaseTextEditorWidget(parent), - m_outlineCombo(0) +GLSLTextEditorWidget::GLSLTextEditorWidget(QWidget *parent) + : TextEditor::BaseTextEditorWidget(parent) { + ctor(); +} + +GLSLTextEditorWidget::GLSLTextEditorWidget(GLSLTextEditorWidget *other) + : TextEditor::BaseTextEditorWidget(other) +{ + ctor(); +} + +void GLSLTextEditorWidget::ctor() +{ + m_outlineCombo = 0; setParenthesesMatchingEnabled(true); setMarksVisible(true); setCodeFoldingSupported(true); @@ -189,8 +200,8 @@ bool GLSLTextEditorWidget::isOutdated() const Core::IEditor *GLSLEditorEditable::duplicate() { - GLSLTextEditorWidget *newEditor = new GLSLTextEditorWidget(); - newEditor->duplicateFrom(editorWidget()); + GLSLTextEditorWidget *newEditor = new GLSLTextEditorWidget( + qobject_cast(editorWidget())); TextEditor::TextEditorSettings::initializeEditor(newEditor); return newEditor->editor(); } diff --git a/src/plugins/glsleditor/glsleditor.h b/src/plugins/glsleditor/glsleditor.h index 5d1b9306a97..831b6e7d04c 100644 --- a/src/plugins/glsleditor/glsleditor.h +++ b/src/plugins/glsleditor/glsleditor.h @@ -87,6 +87,7 @@ class GLSLTextEditorWidget : public TextEditor::BaseTextEditorWidget public: GLSLTextEditorWidget(QWidget *parent = 0); + GLSLTextEditorWidget(GLSLTextEditorWidget *other); ~GLSLTextEditorWidget(); virtual void unCommentSelection(); @@ -110,6 +111,8 @@ protected: void createToolBar(Internal::GLSLEditorEditable *editable); private: + GLSLTextEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity + void ctor(); void setSelectedElements(); QString wordUnderCursor() const; diff --git a/src/plugins/pythoneditor/pythoneditor.cpp b/src/plugins/pythoneditor/pythoneditor.cpp index 26f9b5ffd0d..a75c324ba2d 100644 --- a/src/plugins/pythoneditor/pythoneditor.cpp +++ b/src/plugins/pythoneditor/pythoneditor.cpp @@ -60,10 +60,8 @@ PythonEditor::~PythonEditor() Core::IEditor *PythonEditor::duplicate() { - EditorWidget *widget = new EditorWidget(); - widget->duplicateFrom(editorWidget()); + EditorWidget *widget = new EditorWidget(qobject_cast(editorWidget())); TextEditor::TextEditorSettings::initializeEditor(widget); - return widget->editor(); } diff --git a/src/plugins/pythoneditor/pythoneditorwidget.cpp b/src/plugins/pythoneditor/pythoneditorwidget.cpp index 8c37ab7be5a..4e5b119f3ed 100644 --- a/src/plugins/pythoneditor/pythoneditorwidget.cpp +++ b/src/plugins/pythoneditor/pythoneditorwidget.cpp @@ -48,7 +48,18 @@ namespace PythonEditor { namespace Internal { EditorWidget::EditorWidget(QWidget *parent) - :TextEditor::BaseTextEditorWidget(parent) + : TextEditor::BaseTextEditorWidget(parent) +{ + ctor(); +} + +EditorWidget::EditorWidget(EditorWidget *other) + : TextEditor::BaseTextEditorWidget(other) +{ + ctor(); +} + +void EditorWidget::ctor() { m_commentDefinition.multiLineStart.clear(); m_commentDefinition.multiLineEnd.clear(); diff --git a/src/plugins/pythoneditor/pythoneditorwidget.h b/src/plugins/pythoneditor/pythoneditorwidget.h index ebb76626cda..272eb3c8a48 100644 --- a/src/plugins/pythoneditor/pythoneditorwidget.h +++ b/src/plugins/pythoneditor/pythoneditorwidget.h @@ -42,6 +42,7 @@ class EditorWidget : public TextEditor::BaseTextEditorWidget public: EditorWidget(QWidget *parent = 0); + EditorWidget(EditorWidget *other); virtual ~EditorWidget(); virtual void unCommentSelection(); @@ -53,6 +54,8 @@ protected: TextEditor::BaseTextEditor *createEditor(); private: + EditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity + void ctor(); Utils::CommentDefinition m_commentDefinition; }; diff --git a/src/plugins/qmakeprojectmanager/profileeditor.cpp b/src/plugins/qmakeprojectmanager/profileeditor.cpp index 55c4cfb8016..c9428cb4b97 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.cpp +++ b/src/plugins/qmakeprojectmanager/profileeditor.cpp @@ -61,8 +61,8 @@ ProFileEditor::ProFileEditor(ProFileEditorWidget *editor) Core::IEditor *ProFileEditor::duplicate() { - ProFileEditorWidget *ret = new ProFileEditorWidget(); - ret->duplicateFrom(editorWidget()); + ProFileEditorWidget *ret = new ProFileEditorWidget( + qobject_cast(editorWidget())); TextEditor::TextEditorSettings::initializeEditor(ret); return ret->editor(); } @@ -83,6 +83,17 @@ TextEditor::CompletionAssistProvider *ProFileEditor::completionAssistProvider() ProFileEditorWidget::ProFileEditorWidget(QWidget *parent) : BaseTextEditorWidget(new ProFileDocument(), parent) +{ + ctor(); +} + +ProFileEditorWidget::ProFileEditorWidget(ProFileEditorWidget *other) + : BaseTextEditorWidget(other) +{ + ctor(); +} + +void ProFileEditorWidget::ctor() { baseTextDocument()->setSyntaxHighlighter(new ProFileHighlighter); m_commentDefinition.clearCommentStyles(); diff --git a/src/plugins/qmakeprojectmanager/profileeditor.h b/src/plugins/qmakeprojectmanager/profileeditor.h index b13826e3dd6..a45e83075b7 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.h +++ b/src/plugins/qmakeprojectmanager/profileeditor.h @@ -59,6 +59,7 @@ class ProFileEditorWidget : public TextEditor::BaseTextEditorWidget public: ProFileEditorWidget(QWidget *parent = 0); + ProFileEditorWidget(ProFileEditorWidget *other); void unCommentSelection(); @@ -69,6 +70,8 @@ protected: void contextMenuEvent(QContextMenuEvent *); private: + ProFileEditorWidget(BaseTextEditorWidget *); // avoid stupidity + void ctor(); Utils::CommentDefinition m_commentDefinition; }; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 061bf76054d..1ed5aa94681 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -450,15 +450,26 @@ protected: QmlJSTextEditorWidget::QmlJSTextEditorWidget(QWidget *parent) : - TextEditor::BaseTextEditorWidget(parent), - m_outlineCombo(0), - m_outlineModel(new QmlOutlineModel(this)), - m_modelManager(0), - m_futureSemanticInfoRevision(0), - m_contextPane(0), - m_findReferences(new FindReferences(this)), - m_semanticHighlighter(new SemanticHighlighter(this)) + TextEditor::BaseTextEditorWidget(parent) { + ctor(); +} + +QmlJSTextEditorWidget::QmlJSTextEditorWidget(QmlJSTextEditorWidget *other) + : TextEditor::BaseTextEditorWidget(other) +{ + ctor(); +} + +void QmlJSTextEditorWidget::ctor() +{ + m_outlineCombo = 0; + m_outlineModel = new QmlOutlineModel(this); + m_futureSemanticInfoRevision = 0; + m_contextPane = 0; + m_findReferences = new FindReferences(this); + m_semanticHighlighter = new SemanticHighlighter(this); + m_semanticInfoUpdater = new SemanticInfoUpdater(this); m_semanticInfoUpdater->start(); @@ -583,8 +594,8 @@ QModelIndex QmlJSTextEditorWidget::outlineModelIndex() IEditor *QmlJSEditor::duplicate() { - QmlJSTextEditorWidget *newEditor = new QmlJSTextEditorWidget(); - newEditor->duplicateFrom(editorWidget()); + QmlJSTextEditorWidget *newEditor = new QmlJSTextEditorWidget( + qobject_cast(editorWidget())); TextEditor::TextEditorSettings::initializeEditor(newEditor); return newEditor->editor(); } diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 6b9981ded71..4880ab0988b 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -100,6 +100,7 @@ class QMLJSEDITOR_EXPORT QmlJSTextEditorWidget : public TextEditor::BaseTextEdit public: QmlJSTextEditorWidget(QWidget *parent = 0); + QmlJSTextEditorWidget(QmlJSTextEditorWidget *other); ~QmlJSTextEditorWidget(); virtual void unCommentSelection(); @@ -166,6 +167,8 @@ protected: QString foldReplacementText(const QTextBlock &block) const; private: + QmlJSTextEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity + void ctor(); bool isClosingBrace(const QList &tokens) const; void setSelectedElements(); diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 167a436c579..c374fa1775f 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -200,6 +200,12 @@ BaseTextEditorWidget::BaseTextEditorWidget(BaseTextDocument *doc, QWidget *paren ctor(QSharedPointer(doc)); } +BaseTextEditorWidget::BaseTextEditorWidget(BaseTextEditorWidget *other) +{ + ctor(other->d->m_document); + d->m_revisionsVisible = other->d->m_revisionsVisible; +} + void BaseTextEditorWidget::ctor(const QSharedPointer &doc) { d = new BaseTextEditorWidgetPrivate; @@ -214,7 +220,7 @@ void BaseTextEditorWidget::ctor(const QSharedPointer &doc) d->m_refactorOverlay = new RefactorOverlay(this); d->m_document = doc; - d->setupDocumentSignals(d->m_document); + d->setupDocumentSignals(); d->m_lastScrollPos = -1; @@ -2079,17 +2085,6 @@ bool BaseTextEditorWidget::event(QEvent *e) return QPlainTextEdit::event(e); } -void BaseTextEditorWidget::duplicateFrom(BaseTextEditorWidget *widget) -{ - if (this == widget) - return; - d->m_revisionsVisible = widget->d->m_revisionsVisible; - if (d->m_document == widget->d->m_document) - return; - d->setupDocumentSignals(widget->d->m_document); - d->m_document = widget->d->m_document; -} - void BaseTextEditorWidget::documentAboutToBeReloaded() { //memorize cursor position @@ -2456,16 +2451,9 @@ BaseTextEditorWidgetPrivate::~BaseTextEditorWidgetPrivate() { } -void BaseTextEditorWidgetPrivate::setupDocumentSignals(const QSharedPointer &document) +void BaseTextEditorWidgetPrivate::setupDocumentSignals() { - BaseTextDocument *oldDocument = q->baseTextDocument(); - if (oldDocument) { - q->disconnect(oldDocument->document(), 0, q, 0); - q->disconnect(oldDocument, 0, q, 0); - q->disconnect(q, 0, oldDocument, 0); - } - - QTextDocument *doc = document->document(); + QTextDocument *doc = m_document->document(); q->setDocument(doc); q->setCursorWidth(2); // Applies to the document layout @@ -2477,8 +2465,8 @@ void BaseTextEditorWidgetPrivate::setupDocumentSignals(const QSharedPointerslotUpdateExtraAreaWidth(); } diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 0f01d11ea12..be0dbae9184 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -132,6 +132,7 @@ class TEXTEDITOR_EXPORT BaseTextEditorWidget : public QPlainTextEdit public: BaseTextEditorWidget(QWidget *parent = 0); BaseTextEditorWidget(BaseTextDocument *doc, QWidget *parent = 0); + BaseTextEditorWidget(BaseTextEditorWidget *other); ~BaseTextEditorWidget(); const Utils::ChangeSet &changeSet() const; @@ -356,9 +357,6 @@ private: void updateCannotDecodeInfo(); void collectToCircularClipboard(); -public: - void duplicateFrom(BaseTextEditorWidget *editor); - protected: void setDefaultPath(const QString &defaultPath); diff --git a/src/plugins/texteditor/basetexteditor_p.h b/src/plugins/texteditor/basetexteditor_p.h index be90639735e..8d476bab311 100644 --- a/src/plugins/texteditor/basetexteditor_p.h +++ b/src/plugins/texteditor/basetexteditor_p.h @@ -102,7 +102,7 @@ public: BaseTextEditorWidgetPrivate(); ~BaseTextEditorWidgetPrivate(); - void setupDocumentSignals(const QSharedPointer &document); + void setupDocumentSignals(); void updateLineSelectionColor(); void print(QPrinter *printer); diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 5d618d2c4db..09d0f5b7bec 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -69,6 +69,12 @@ PlainTextEditorWidget::PlainTextEditorWidget(BaseTextDocument *doc, QWidget *par ctor(); } +PlainTextEditorWidget::PlainTextEditorWidget(PlainTextEditorWidget *other) + : BaseTextEditorWidget(other) +{ + ctor(); +} + void PlainTextEditorWidget::ctor() { m_isMissingSyntaxDefinition = false; @@ -88,8 +94,8 @@ void PlainTextEditorWidget::ctor() IEditor *PlainTextEditor::duplicate() { - PlainTextEditorWidget *newWidget = new PlainTextEditorWidget(); - newWidget->duplicateFrom(editorWidget()); + PlainTextEditorWidget *newWidget = new PlainTextEditorWidget( + qobject_cast(editorWidget())); TextEditorSettings::initializeEditor(newWidget); return newWidget->editor(); } diff --git a/src/plugins/texteditor/plaintexteditor.h b/src/plugins/texteditor/plaintexteditor.h index 88118054e00..e56b552bd63 100644 --- a/src/plugins/texteditor/plaintexteditor.h +++ b/src/plugins/texteditor/plaintexteditor.h @@ -61,6 +61,7 @@ class TEXTEDITOR_EXPORT PlainTextEditorWidget : public BaseTextEditorWidget public: PlainTextEditorWidget(QWidget *parent = 0); PlainTextEditorWidget(BaseTextDocument *doc, QWidget *parent = 0); + PlainTextEditorWidget(PlainTextEditorWidget *other); void configure(const QString& mimeType); void configure(const Core::MimeType &mimeType); @@ -81,6 +82,7 @@ protected: virtual BaseTextEditor *createEditor() { return new PlainTextEditor(this); } private: + PlainTextEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity void ctor(); bool m_isMissingSyntaxDefinition;