Add a license header template for C++ code | Qt Creator Documentation

- Qt Creator Documentation
- Add a license header template for C++ code
- Qt Creator 17.0.1

How To

# Add a license header template for C++ code

Specify a file that has a license header for C++ in Preferences > C++ > File Naming > License template.

The license file may have special placeholders enclosed in `%%` that are replaced when generating a new file:

1. `%YEAR%`: Year
2. `%MONTH%`: Month
3. `%DAY%`: Day of the month
4. `%DATE%`: Date
5. `%USER%`: Username
6. `%FILENAME%`: File name
7. `%CLASS%`: Class name (if applicable)
8. `%$VARIABLE%`: Contents of environment variable `VARIABLE`.

In addition, placeholders in the form %{..} are replaced by the value of the corresponding Qt Creator variable.

See also Use Qt Creator variables.

How To