TextEditor: Return BaseTextEditor for duplicate

Because the type is always a BaseTextEditor we can return a
BaseTextEditor type. C++ is allowing to change the overload return type
so long it is compatible.

Change-Id: Ib4c88faaa6fdfb97fd03c51a120de0fa0c2d00cd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marco Bubke
2023-04-18 15:59:19 +02:00
parent cf61025af6
commit 79b5a9f03e
3 changed files with 4 additions and 5 deletions

View File

@@ -80,8 +80,7 @@ void TextEditorView::modelAttached(Model *model)
AbstractView::modelAttached(model);
auto textEditor = Utils::UniqueObjectLatePtr<TextEditor::BaseTextEditor>(
static_cast<TextEditor::BaseTextEditor *>(
QmlDesignerPlugin::instance()->currentDesignDocument()->textEditor()->duplicate()));
QmlDesignerPlugin::instance()->currentDesignDocument()->textEditor()->duplicate());
// Set the context of the text editor, but we add another special context to override shortcuts.
Core::Context context = textEditor->context();