openPilotLog
|
Public Member Functions | |
NewFlightDialog (QWidget *parent=nullptr) | |
NewFlightDialog create a new flight and add it to the logbook. More... | |
NewFlightDialog (int row_id, QWidget *parent=nullptr) | |
NewFlightDialog Edit an existing logbook entry. | |
|
explicit |
NewFlightDialog create a new flight and add it to the logbook.
Construction ///.
[F] The general idea for this dialog is this:
if the user presses "OK", check if all mandatory inputs are valid, check if optional user inputs are valid and commit.
For the completion and mapping, I have settled on a more low-level approach using Completers based on QStringLists and mapping with QMaps.
I implemented the Completers and mapping based on a QSqlTableModel which would have been quite nice, since it would keep all data in one place, providing both completion and mapping in one model. But as we have seen before with the more high-level qt classes, they are quite slow on execution when used for tasks they were probably not designed to do. Mapping a registration to an ID for example took around 300ms, which is very noticeable in the UI and not an acceptable user experience. Using QStringLists and QMaps this goes down to around 5ms.