Discussion:
[Qt-creator] Events with CTRL modifier not working with CustomEditorWidget
sanjay chopra
2018-07-28 09:28:54 UTC
Permalink
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.
--
*RegardsSanjay*
Eike Ziller
2018-08-07 07:12:12 UTC
Permalink
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
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
***@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
Loading...