How to add short-key for “Add Definition in class.

2019-03-14 16:15发布

When you define a member function in a class Interface in Qt creator you can right click on the function prototype and select Refactor->Add Definition in YouClass.cpp . But this will be really handy If you can set a shortcut for it. I couldn't find it in options->shortcut section. enter image description here

For example in Visual Assist you can press ALT+SHIFT+Q.

标签: qt qt-creator
2条回答
2楼-- · 2019-03-14 16:40

You can Alt+return click on the selected function and then press the menu item that appears, there might be another solution with a macro or something

查看更多
女痞
3楼-- · 2019-03-14 16:43

As proposed by @Robin Karlsson:

You can press Alt+Enter to open a context menu that contains refactoring actions available in the current cursor position.

As mentioned by @Dmitry Volosnykh, the above appears in the documentation (more concretely at Applying Refactoring Actions )

(I'd have added this as a comment, but not enough reputation yet)

查看更多
登录 后发表回答