Hi Luis,<div><br></div><div>I understand your concern. </div><div><div><br></div><div>We can't change the name of the method index() as it is a virtual method that has been declared in a Qt subclass.</div></div><div>And the problem we face here is that the Qt library doesn't care about shadow variables. (and if I recall, they didn't plan on changing that).</div>
<div><br></div><div>We unofficially decided during the CTK Pre Hackfest that a CTK class should follow the naming convention of its derived class, Qt in this example.</div><div>Is that still OK for everybody ?</div><div>
<br>
</div><div>Setting up KWStyle seems like a good idea. Can we configure it in a way to check a style depending on a filename (ideally the style of the derived class)</div><div><br></div><div>Julien.</div><div><br><div class="gmail_quote">
On Thu, Apr 8, 2010 at 5:50 PM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I recall that at some point we discussed a<br>
naming convention for Qt-like classes, but<br>
I'm not sure if we arrived to a consensus.<br>
<br>
<br>
The file:<br>
<br>
Libs/DICOM/Core/ctkDICOMModel.cxx<br>
<br>
had an abundant use of local variables with<br>
names matching some member variables and<br>
member methods.<br>
<br>
A notable example:<br>
<br>
"index"<br>
<br>
I just committed a fix for most of them,<br>
but for the long run it will be great if we<br>
agree on some naming convention.<br>
<br>
I would vote against having a method of a C++ class<br>
to be called "index()" for example. :-)<br>
<br>
a more useful name will be "getIndex()", for example,<br>
or in this particular case, it looks like what the function<br>
is actually doing is generating an index, so good names<br>
could be<br>
<br>
ctkDICOMModel::generatgeIndex ( int row, int column, const QModelIndex<br>
& parentValue ) const<br>
<br>
or<br>
<br>
ctkDICOMModel::computeIndex ( int row, int column, const QModelIndex &<br>
parentValue ) const<br>
<br>
or<br>
<br>
ctkDICOMModel::produceIndex ( int row, int column, const QModelIndex &<br>
parentValue ) const<br>
<br>
<br>
There is already another<br>
<br>
createIndex(int, int, Node *)<br>
<br>
<br>
so it will be fine if we use<br>
<br>
ctkDICOMModel::createIndex ( int row, int column, const QModelIndex &<br>
parentValue ) const<br>
<br>
since the signature will be different.<br>
<br>
<br>
---<br>
<br>
<br>
Do we have a document on coding style ?<br>
<br>
if we do,<br>
we probably should setup KWStyle testing<br>
before things get out of control.<br>
<font color="#888888"><br>
<br>
<br>
Luis<br>
</font></blockquote></div><br></div>