Framework: Qt5 (C++)
Database: sqlite3
This program is suppposed to replace a paper logbook with an electronic version. As a first step, I want to focus on the basics, and then add 'nice-to-haves' later. These are the guidelines for this project:
The most straight forward way is to get a copy of Qt and compile the project using cmake.
On first launch, you will run through a setup wizard for the database. If you want to test the program with a sample database, use the Backup
functionality. Select Restore external backup
from the GUI and import the file logbook.db
from the assets folder in the repository.
The setup wizard for the database requires openSSL to download the most recent data. In order for this to work on Windows, you need to place the openSSL dll's in the application directory. On Linux, this is normally not an issue. If you are running into problems there, try installing the openssl-dev
package or similar from your distribution's package manager.
When compiling with CMake, instead of updating the translations, there is a bug that might instead delete them. See here and here. Long story short, make sure to use a version of CMake that is 3.16 or earlier, or 3.19.2 or later if you want to use localisations other than English (once they're implemented).
Keeping a logbook of flights is a quintessential database task. This program could thus be seen as a user-friendly front-end to a database. The database is a sqlite3-Database, which is described in detail on the Database Wiki Page.
Access to the database is provided by the OPL::Database Class, which is responsible for managing the database connection and creating and executing queries. Data is retreived from the database in form of Row objects. The OPL::Row class and its subclasses represent 'lines' in a database table. Internally, they are structs holding a QQHash with the key being the column name and the value its value. These Objects are then parsed by the different widgets and dialogues to read or write user-provided data.
The database contents are displayed to the user in the different widgets. Flights are displayed in the LogbookWidget, Pilots in the PilotsWidget and Aircraft in the AircraftWidget. These widgets also give convenient access to the Dialogues (NewFlightDialog, NewPilotDialog, NewTailDialog), enabling editing, adding or removing entries of their respective categories.
Widget class Elements of the User Interface dispay data from the database in a QTableView with a QSqlQueryModel. Dialog class UI Elements receive and return OPL::Row objects, which are read and written to and from the database via the OPL::Database class.
Settings are stored in a .ini
file at a standardized location. The Settings widget enables the user to adjust various settings, which are stored and accessed via the Settings class, based on the QSettings interface.
The BackupWidget enables creating and restoring backup copies of the database.