This project is a C++/QML desktop application that provides a table-based interface for managing and editing "regimes." The application allows users to:
- View and edit a list of regimes in a table.
- Group and ungroup regimes into cycles.
- Reorder regimes and cycles.
- Add and delete regimes.
- Persist changes to a JSON file.
The application is built using the Qt framework, with the UI implemented in QML and the business logic in C++.
- C++: Used for the core application logic, including the data model.
- Qt: The underlying application framework.
- QML: Used for the user interface.
- CMake: The build system.
- Google Test: Used for unit testing.
The application follows a Model-View-ViewModel (MVVM) architecture:
- Model: The
ProtoTableModelclass, which is aQAbstractTableModelthat manages the list of regimes. - View: The
Main.qmlfile, which defines the user interface. - ViewModel: The
ProtoTableModelalso acts as the ViewModel, exposing data and commands to the QML view.
To build the project, run the following commands from the root directory:
cmake -S . -B build
cmake --build buildTo run the application, execute the following command from the root directory:
./build/prototype_tableTo run the unit tests, execute the following command from the root directory:
./build/tests/ProtoTableTestsThe C++ code follows the Qt coding style.
Unit tests are written using the Google Test framework and are located in the tests directory. The tests cover the core functionality of the ProtoTableModel class.
The data model is defined in the regime.h file. The Regime and Condition structs are exposed to the meta-object system using Q_GADGET, which allows them to be passed by value between C++ and QML.
The QML code is located in the qml directory. The main view is Main.qml, which uses a TableView to display the data from the ProtoTableModel. The controlsView provides the user interface for grouping, ungrouping, and reordering rows.