Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | - Implementation code should go into the `.cpp` file and not the `.h`, unless necessary due to template usage or | ||||
- *Rationale*: Shorter and simpler header files are easier to read, and reduce compile time | - *Rationale*: Shorter and simpler header files are easier to read, and reduce compile time | ||||
- Don't import anything into the global namespace (`using namespace ...`). Use | - Don't import anything into the global namespace (`using namespace ...`). Use | ||||
fully specified types such as `std::string`. | fully specified types such as `std::string`. | ||||
- *Rationale*: Avoids symbol conflicts | - *Rationale*: Avoids symbol conflicts | ||||
Header Inclusions | |||||
----------------- | |||||
- Header inclusions should use angle brackets (`#include <>`). | |||||
The include path should be relative to the `src` folder. | |||||
e.g.: `#include <qt/test/guiutiltests.h>` | |||||
- Native C++ headers should be preferred over C compatibility headers. | |||||
e.g.: use `<cstdint>` instead of `<stdint.h>` | |||||
- In order to make the code consistent, header files should be included in the following order, with each | |||||
section separated by a newline: | |||||
1. In a .cpp file, the associated .h is in first position. In a test source, this is the header file under test. | |||||
2. The project headers. | |||||
3. The test headers. | |||||
4. The 3rd party libraries headers. Different libraries should be in different sections. | |||||
5. The system libraries. | |||||
All headers should be lexically ordered inside their block. | |||||
GUI | GUI | ||||
----- | ----- | ||||
- Do not display or manipulate dialogs in model code (classes `*Model`) | - Do not display or manipulate dialogs in model code (classes `*Model`) | ||||
- *Rationale*: Model classes pass through events and data from the core, they | - *Rationale*: Model classes pass through events and data from the core, they | ||||
should not interact with the user. That's where View classes come in. The converse also | should not interact with the user. That's where View classes come in. The converse also | ||||
holds: try to not directly access core data structures from Views. | holds: try to not directly access core data structures from Views. | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |