Add code snippets to the auto-complete menu

To add code or text snippets in the snippet editor:

  1. Select Preferences > Text Editor > Snippets.

    {Snippets preferences}

  2. In Group, select the type of snippet to add.
  3. Select Add.
  4. 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 QML code in the snippet editor, depending on the snippet category.

See also Completion and Snippets.

Available under certain Qt licenses.
Find out more.