Qt4Ada - An Ada2005 binding to Qt4

 

Everyone is welcome to contribute. Even if you're not an expert programmer neither in Ada nor C++, there are many simple (and annoying) tasks that need to be done.

If you intend to contribute, please first have a look at the actual code to get an idea (through Subversion browser) to what it looks like. You may start by the examples.

Then read Translating C++ to Ada to see how to convert basic things from C++ to Ada. Only rather basic knowledge of both language is really needed here. If this is not enough, you can go further by reading Virtual C++ ↔ Ada Dispatch to see how the C++ virtual methods are transposed into Ada dispatching calls.

At last, here are some general conventions everyone contributing is encouraged to follow. Some (if not most) are absolutely subjective (e.g. indentation width) and reflect author's taste.

If after all this you still want to help in this project, join the mailing-list and grab the source code in its latest state with:

$ svn co https://svn.sourceforge.net/svnroot/qt4ada qt4ada

Basic coding standards

Charset

Each source text file should be encoded using UTF-8. This is to avoid possible issues mainly in strings.

Tabs and indentation

Don't used tabs in source file. Until everyone use an elastic tabs-capable editor, tabs are strictly forbidden. Period.

Always replace tabs by 3 spaces. This is the wanted indentation width. The author finds 2 is too small, while 4 is too wide. 3 is fine.

Naming conventions

General types

The types declared in C++ shall be "ada-ified", i.e. each word composing its name shall start by an uppercase and the words shall be separated by an underscore. For example, the C++ type ImageConversionFlag would become Image_Conversion_Flag in Ada.

Classes

The Ada tagged types shall be the same as the corresponding C++ classes. For example, the C++ class QObject would be translated as an Ada tagged type named QObject.

Packages

For packages which define a type corresponding to a C++ class, the package shall be named from the type name (or class name, see above) in plural form. For example, the package defining the type QWidget would be named QWidgets.

Functions and methods

The names of functions and methods shall follow the same rule as general types, so a method named setModelData in C++ would be named Set_Model_Data in Ada.