Adding, modifying, deleting tasks:

Filtering, sorting. Restarting the application (and saving tasks):

Need to implement a small TODO-list application using Qt6. User should be able to add/delete tasks, change their status and filter them. Full description of the task is available here.
To ensure that tasks are not deleted when the application is closed, I add them to a PostgreSQL database.
From the bonuses:
- Sorting tasks.
- Checking the "In Progress", "Paused" and "Done" boxes.
- Task highlighting, including overdue tasks.
- Ability to delete several tasks at once.
The development was done on Debian 12 using only standard packages.
Important: the clang-format command is automatically called first every time a project is built. It can be disabled by removing lines 44-50 and 54 from CMakeLists.txt.
First you need to prepare the database for work (otherwise the programme will terminate with an error):
bash init_db.shAnd then build the project with a Makefile that already runs cmake:
makeRun the application from the root folder of the project:
./TODO-listThe programme has also been tested to run on Ubuntu. This will require:
- Firstly, install the required packages:
sudo apt install g++ make cmake postgresql qt6-base-dev libqt6sql6-psql clang-format libgl1-mesa-dev libglvnd-dev- Second, you may need to downgrade
cmake_minimum_required. And also in CMakeLists.txt replaceqt_standard_project_project_setup()with:
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)- Thirdly, there may be access problems with the postgres user. In this case, execution of
bash init_db.shwill be accompanied by strange messages about Permission denied. Then you should run each command from the initial.sql file line by line:
sudo -u postgres psql -q -d todo_db -c ¨CREATE SCHEMA todo AUTHORIZATION todo_user;¨
...
sudo -u postgres psql -q -d todo_db -c ¨GRANT ALL ON ALL TABLES IN SCHEMA todo TO todo_user;¨Now the app will launch for sure!
- It is possible to build an application with
-fsanitize=address -fsanitize=leak -fsanitize=undefined:
make debugA programme is created with the same name - TODO-list.
- Tests using QtTest are written for the project (namely for the part of the project that is responsible for interacting with the database, filtering and sorting tasks - DbTaskController). The tests are located in the tests folder. Build and run the tests:
make tests && ./TODO-testsOutput:
All database objects used in the application can be deleted with the following command:
bash clear_db.shWhat could be added and what could be improved?
- Write more tests.
- Work out filtering and sorting of tasks. The current algorithm doesn't seem to be the most efficient (especially sorting, when there is a complete deletion and creation of tasks at each operation).
- Add translation to other languages.
- Add support for other OS.
- Remove the incs folder.
- Move visual design to ui files (to separate design from logic).
- Move icons to resource files.
