Qnx: Fixing Bar Descriptor XML file editor to provide editor actions

BarDescriptorEditorWidget is using TextEditorActionHandler class
to provide editor actions e.g. Undo, Redo, Cut, Copy, Paste accessible
from main menu and using shortcuts.

TextEditorActionHandler.resolveTextEditorWidget() virtual function is
added to all resolving TextEditorWidget for an Editor. This allows
to have IEditor->widget() to have non-BaseTextEditorWidget instances too.

Task-number: QTCREATORBUG-10040
Change-Id: I6f433fc307c13ef2b2a20c48e6473826f2619544
Reviewed-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
David Kaspar
2013-10-17 09:16:18 +02:00
parent ab4207acf2
commit 3d2ef178f6
8 changed files with 69 additions and 4 deletions

View File

@@ -560,6 +560,11 @@ FUNCTION(gotoNextWordCamelCase)
FUNCTION(gotoNextWordCamelCaseWithSelection)
BaseTextEditorWidget *TextEditorActionHandler::resolveTextEditorWidget(Core::IEditor *editor) const
{
return qobject_cast<BaseTextEditorWidget *>(editor->widget());
}
void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
{
m_currentEditor = 0;
@@ -567,7 +572,7 @@ void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
if (!editor)
return;
BaseTextEditorWidget *baseEditor = qobject_cast<BaseTextEditorWidget *>(editor->widget());
BaseTextEditorWidget *baseEditor = resolveTextEditorWidget(editor);
if (baseEditor && baseEditor->actionHack() == this) {
m_currentEditor = baseEditor;