问题
I recently switched to QTCreator for C++ from Eclipse background.
I am looking for these two features in QtCreator...
(1) I want to open the file a class is written in by typing that class's name. For example Ctrl+Shft+T in Eclipse.
(2) I want to move back to where my cursor were before the current operation.
Any shortcuts for above two features?
回答1:
To open the file of a class:
- If you are in a file that is making use of the class, you can place the cursor on the class then press F2. By default, F2 is bound to the Follow Symbol Under Cursor action.
- If you want to get to the class without to find an instance of it, you can use the Locator . By default Press:
ctrl
+k
to access the locator- Type
c
thenspace
to locate classes - Now type the name of your class. Once you've selected the class, hit
enter
To navigate back to where you were, you can use GoBack and GoForward, as mentioned by Roman Zaytsev. These default to
alt
+left
andalt
+right
. It has been many years since I have used eclipse, but I thought it also usedalt
+left
andright
as I was pleased to find QtCreator used it as well.
回答2:
(2) I want to move back to where my cursor were before the current operation.
Go to Tools > Options > Environment > Keyboard. There assign shortcuts for "GoBack" and "GoForward" in "QtCreator" section.
来源:https://stackoverflow.com/questions/32128181/qtcreator-for-eclipse-users