Qt Creator Changing the default C++ Class template
Hi I'm trying to find where the template is kept for the C++ class so I can edit the header and the implementation file to include some other bits and pieces, but I can't seem to locate them. I've found the other wizards as described http://doc.qt.io/qt-4.8/http://doc.qt.nokia.com/qtcreator-2.4/creator-project-wizards.html but I can't find the class wizard there. Does anyone know where it might be.
Thanks.
Re: Qt Creator Changing the default C++ Class template
You can include a licence template to be included at the top of new h and cpp files using Tools > Options > C++ > File Naming.
On my Linux box there are buckets of templates under: /usr/share/qtcreator/templates
I am sure you can find the equivalent location on your platform.
Re: Qt Creator Changing the default C++ Class template
This is where I was expecting to find it but as far as I can tell its not there.
Re: Qt Creator Changing the default C++ Class template
How have you installed Qt Creator? Part of the Qt SDK... then look under {path to}/QtSDK/QtCreator/share/qtcreator/templates.
Failing that, open a shell and type:
Code:
locate -b qt4project
# OR
find / -type d -name qt4project
Re: Qt Creator Changing the default C++ Class template
Sorry I should have been clearer the file exists, and QtCreator is installed. The problem is none of the files in templates or the sub folders appear to relate to the new class template.
Re: Qt Creator Changing the default C++ Class template
I also wanted to know this, since I much prefer having `#pragma once` to the old and hacky #include guards.
Unfortunately it is all hard-coded so you would need to recompile QtCreator to change the template:
https://qt.gitorious.org/qt-creator/...izard.cpp#L199
Re: Qt Creator Changing the default C++ Class template
At least those "old and hacky" include guards are guaranteed to work everywhere unlike the non-standard "#pragma once". Feel free to propose the patch to make this either fully templated or optionally use the pragma.