Add code snippets to the auto-complete menu
To add code or text snippets in the snippet editor:
- Select Preferences > Text Editor > Snippets.
- In Group, select the type of snippet to add.
- Select Add.
- Specify a trigger. If the trigger is already in use, add an optional variant. They appear in the list of suggestions when you write code. Also specify a text string or C++ or QML code construct in the snippet editor, depending on the snippet category.
You can use predefined variables in snippets.
See also Complete CMake code, Complete code, Use Qt Creator variables, Nim, Completion, and Snippets.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.