Raistlin
24th February 2007, 10:50
I like to follow a certain coding style for my classes, following the following template :
class SomeClass : public SomeBaseClass
{
public :
void somePublicFunction();
int someVariable() const;
void setSomeVariable(const int& value);
float anotherVariable() const;
void setAnotherVariable(const float& value);
...
private:
void somePrivateFunction();
...
int someVariable_;
float anotherVariable_;
}
However, when I am working on a Qt project with for example a large QMainWindow derived class, I tend to break this style. There are so many private QAction's, QMenu's, QToolbar's and other Qt based objects that I feel they make the code less readable if I append an underscore.
Do any of you guys tend to do something similar in specific cases, or do you follow your coding style strictly on every occasion ?
class SomeClass : public SomeBaseClass
{
public :
void somePublicFunction();
int someVariable() const;
void setSomeVariable(const int& value);
float anotherVariable() const;
void setAnotherVariable(const float& value);
...
private:
void somePrivateFunction();
...
int someVariable_;
float anotherVariable_;
}
However, when I am working on a Qt project with for example a large QMainWindow derived class, I tend to break this style. There are so many private QAction's, QMenu's, QToolbar's and other Qt based objects that I feel they make the code less readable if I append an underscore.
Do any of you guys tend to do something similar in specific cases, or do you follow your coding style strictly on every occasion ?