Questions regarding templates

Sandy Meier smeier at rz.uni-potsdam.de
Sun Jan 9 15:06:55 GMT 2000


On Sat, 08 Jan 2000 you wrote:
> Hi all. I'm new to C++ and using QT/KDE, so I ask you to bear with my stupidity.
> 
> As I'm trying to develop my first project, I have the following questions:
> 1. Is there anywhere that it's referenced what fields are replaced in templates?
> Just the ones there (DATE, AUTHOR) or are there others/ can one add custom
> ones?

You can only add new keywords by changing the sourcecode in cproject.cpp :

QString& CProject::setInfosInString(QString& strtemplate, bool basics) {
   QString date=QDate::currentDate().toString();
   QString year;
   year.setNum(QDate::currentDate().year());
   QString projectName=getProjectName();
 
   strtemplate.replace(QRegExp("\\|PRJNAME\\|"), projectName);
   strtemplate.replace(QRegExp("\\|NAME\\|"), projectName);
   strtemplate.replace(QRegExp("\\|NAMELITTLE\\|"), projectName.lower());
   strtemplate.replace(QRegExp("\\|NAMEBIG\\|"), projectName.upper());
 
   strtemplate.replace(QRegExp("\\|PRJDIR\\|"), getProjectDir());
   strtemplate.replace(QRegExp("\\|PRJFILE\\|"), getProjectFile());
   strtemplate.replace(QRegExp("\\|SUBDIR\\|"), getSubDir());
   strtemplate.replace(QRegExp("\\|AUTHOR\\|"), getAuthor());
   strtemplate.replace(QRegExp("\\|EMAIL\\|"), getEmail());
   strtemplate.replace(QRegExp("\\|VERSION\\|"), getVersion());
   strtemplate.replace(QRegExp("\\|BINPROGRAM\\|"), getBinPROGRAM());
   strtemplate.replace(QRegExp("\\|DATE\\|"), date);
   strtemplate.replace(QRegExp("\\|YEAR\\|"), year);       
...........


> 3. (Last stupid question of this email!) Is it possible to create a
> titlebar-less window, for example, like xmms does?

Please look at "WFlags" in the "QWidget" documentation.

Ciao!
Sandy

--
Hi! I'm a signature virus! Copy me into your signature file to help me
spread!




More information about the KDevelop mailing list