[Qt-creator] About a new feature

Friedemann Kleint Friedemann.Kleint at nokia.com
Thu Jul 30 09:20:42 CEST 2009


Hi,

> I like it!
>
> The only addition I require when creating a new C++ class, etc. is the
> following at the top of each .h/.cpp file:
>
> // $Id$

You don't have to do manually this if you use one of the daily packages or a 
current source checkout of Qt Creator  - it provides a license header template 
file setting under Tools/Options/C++.

The code is in src/plugins/cpptools/cppfilesettingspage.cpp; you might want to 
start from there. The wizards access it via a static function in 
cpptools/AbstractEditorSupport, which calls a function in 
cppfilesettingspage.cpp that does some simple Macro expansion:

 %USER% %DATE% %YEAR%
Environment variables: %$VARIABLE%

We went for %% placeholders as to avoid any clash with versioning system 
keywords.

Regards,
Friedemann

PS: AbstractEditorSupport is arguably not the best place for such 
functionality, it might change in the future.

-- 
Friedemann Kleint
Nokia, Qt Software

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090730/ae7f3827/attachment.html 


More information about the Qt-creator-old mailing list