Qt Creator Placeholders

I found out that Qt Creator can insert the title of the license template when creating a new file and fill in certain placeholders automatically, like the file name and year:

/**
  @file   %FILENAME%
  Copyright (c) %YEAR%
*/

Are these placeholders documented anywhere? Maybe on some list?

PS: Under this error message ( QTCREATORBUG-14726 ), Tobias Hunger commented that the new macro style of this format is: to %{CurrentDate:FORMATSTRING}be used. But I can not find the documentation for this!

+4
source share
2 answers

I don’t see anything where the license file already exists, but on the Qt website it says the following:

++

, ++, > > ++ > . , %%, :

%YEAR%: Year
%MONTH%: Month
%DAY%: Day of the month
%DATE%: Date
%USER%: Username
%FILENAME%: File name
%CLASS%: Class name (if applicable)
%$VARIABLE%: Contents of environment variable VARIABLE.

:

Tools->Options...->C++->File Naming
+3

OP, , QtCreator 4.2.0:

%{Cpp:License:FileName}
%{Env:<Environmentalvar>} E.g: %{Env:PATH}
%{CurrentDate:yyyy-MM-dd}
%{Cpp:License:ClassName}

QtCreator Sources. .

+1

Source: https://habr.com/ru/post/1624073/


All Articles