Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.77 KB

README.developers.md

File metadata and controls

64 lines (44 loc) · 1.77 KB

Note: If you start working with code, please read though the following rules:

1. Official ChessX's source code at

https://github.com/Isarhamster/chessx

2. Use Qt naming scheme.

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()

3. Use Doxygen format to comment your code

  • 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) or GUI

  • 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.

4. Format your code with tabs

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> ...