Adicionar trechos de código ao menu de autocompletar
Para adicionar trechos de código ou texto no editor de trechos:
- Selecione “ Preferences ” > “ Text Editor ” > “ Snippets ”.

- Em “ Group ”, selecione o tipo de trecho a ser adicionado.
- Selecione “ Add ”.
- Especifique um gatilho. Se o gatilho já estiver em uso, adicione uma variante opcional. Elas aparecem na lista de sugestões quando você escreve código. Especifique também uma sequência de texto ou uma construção de código C++ ou QML no editor de trechos, dependendo da categoria do trecho.
É possível usar variáveis predefinidas nos trechos de código.
Veja também Código CMake completo, Código completo, Usar variáveis “ Qt Creator ”, Autocompletar, Nim e 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.