Note: If you start working with code, please read though the following rules:
https://github.com/Isarhamster/chessx
You may have a look at the Qt API to learn it
Here are some examples:
- Classes:
BoardView
,Filter
- Classes with acronyms:
PgnDatabase
- Class variables:
m_list
,m_darkSquareColor
- Reading class variable:
QString title() const
- Setting class variable:
void setTitle(const QString& s) const
- Checks:
isReadOnly()
- Functions with acronyms:
moveToSan()
,fromSan()
- Start a class documentation with the Doxygen header
/** @ingroup Database
The Board class represents a chess position.
Pieces are kept directly on the board which is internally represented as simple array[0..63].
You can easily and quickly make and undo moves, although undoing moves requires keeping track
of captured pieces.
*/
-
@ingroup should contain
Database
(for non-GUI classes) orGUI
-
Next sentence should have
The Foo class represents
or... is
syntax -
Document each function
/** Sets widget color. */
void setColor(const QColor& color);
/** @return widget color. */
QColor color() const;
- Rebuild documentation with
$ doxygen Doxyfile
and verify that your class is documented correctly.
We advocate using astyle to indent your code. To use astyle, put
suffix=none style=linux mode=c force-indent=tab=4 one-line=keep-blocks unpad=paren pad=oper
in ~/.astylerc
. Then you can indent your code using:
$ astyle <file1> <file2> ...