[Qt-creator] Events with CTRL modifier not working with CustomEditorWidget

Eike Ziller Eike.Ziller at qt.io
Tue Aug 7 09:12:12 CEST 2018


Hi,

these standard actions are handled by a “TextEditorActionHandler”.
There is (should be) exactly one TextEditorActionHandler instance per editor _type_.
If you look at the implementation of the CppEditorFactory constructor, that calls setEditorActionHandlers(....) which creates a TextEditorActionHandler instance for the factories id(), which at this point of time is CPPEDITOR_ID, as set at the beginning of the CppEditorFactory constructor.

Since you will want your own document / widget / editor / completer set anyhow, I’d suggest that you do not use CppEditorFactory as a base.

Br, Eike

> On 28. Jul 2018, at 11:28, sanjay chopra <sanjuchopracool at gmail.com> wrote:
> 
> Hi,
> 
> I am writing a plugin which will show assembly output for the current opened C/C++ file. (https://github.com/sanjuchopracool/CodeInsight)
> I created an editor factory which is actually using CppEditorFactory and for Editor widget , I created a widget which use CppEditorWidget and add it into the a splitter along with a push button(later it will be a text editor which will show assembly code).
> It is working but there is an annoying issue with editing. All the event which use CTRL modifier (e.g. CTRL+A, CTRL+SHIFT+Up) are not working for editor widget. Editor widget is CppEditor which is BaseTextEditorWidget.When O open C/C++ files with standard editor, everything works.
> 
> I am not able to figure out the issue. Please help me to fix this issue.
> 
> <Context_Menu.png>
> <Custom_editor.png>
> 
> -- 
> Regards
> Sanjay
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list