在自动完成菜单中添加代码片段

在代码片段编辑器中添加代码或文本片段:

  1. 选择首选项>Text Editor >Snippets

    文本编辑器首选项中的 "片段 "选项卡

  2. Group 中,选择要添加的片段类型。
  3. 选择Add
  4. 指定触发器。如果触发器已在使用中,请添加一个可选变量。它们会在你编写代码时出现在建议列表中。还可根据片段类别,在片段编辑器中指定文本字符串或 C++ 或 QML 代码结构。

    你可以在片段中使用预定义变量

另请参阅 完整 CMake 代码完整代码使用Qt Creator 变量Nim完成片段

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.