[SOLVED] customizing templates for source/header files
-
According to the Qt Creator sources the directory is the same for all platforms. You'll find a listing "here":http://pastebin.com/RVw4X4SC if you want to locate the directory by its contents.
-
Based on this "doc":http://doc.qt.nokia.com/4.7-snapshot/install-mac.html, You would have set the PATH during installation i guess. So, looking at PATH may give u hint..
-
I have no idea what's going on now. I just installed the new release, and I still don't have a Trolltech directory anywhere that I can find.
Here's where I installed it, and what I got:
@Macintosh-d49a20f3c0dc:Qt mzimmers$ pwd
/Volumes/64_GB_SSD/Developer/Applications/Qt
Macintosh-d49a20f3c0dc:Qt mzimmers$ ls
Assistant.app InstallationLog.txt SDKMaintenanceTool.ini
Changelog.txt Licenses Simulator
Demos Madde Symbian
Desktop Qt Creator.app components.xml
Documentation SDKMaintenanceTool.app readme
Examples SDKMaintenanceTool.dat
@It wanted to install into a directory under my username, but I prefer keeping my apps in a more centralized location.
-
Qt Creator.app might be an "application bundle":http://en.wikipedia.org/wiki/Application_bundle#Mac_OS_X_application_bundles, "containing":http://www.mactipsandtricks.com/articles/Wiley_HT_appBundles.lasso all the files for Qt Creator, including the ones you are looking for.
-
You will find the templates for the stand alone Qt Creator app in
@
/Applications/Qt Creator.app/Contents/Resources/templates
@The templates for the C++ files are in the subfolder "qt4project".
Replace "/Applications" with the folder where you have put the Qt Creator binary.
The path may be different for SDK downloads, I never checked those.
-
Hey, thanks, Volker:
Here's the contents of my folder:
@Macintosh-d49a20f3c0dc:qt4project mzimmers$ ls
customwidgetwizard mywidget.h widget.ui
main.cpp mywidget_form.cpp
mywidget.cpp mywidget_form.h
Macintosh-d49a20f3c0dc:qt4project mzimmers$
@Neither of the .h files seem to match what I get when I create a new .h file. Do the default contents for new files come from somewhere else, perhaps?
-
I just checked the sources. The contents of a new header file is hard coded into Qt Creator. It is always of the format
@
#ifndef FILENAME_IN_UPPER_CASE_H
#define FILENAME_IN_UPPER_CASE_H#endif // FILENAME_IN_UPPER_CASE_H
@The only thing you can customize is a license template, that is prepended on the very top of the file.
The same holds for a single new C++ source file, with the exception, that this one is plain empty (it only contains a single newline, and optionally the license template).
I'm sorry - you will either need to hack Qt Creator (in file qt-creator-master/src/plugins/cppeditor/cppfilewizard.cpp) or live with the current "template".