| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | .TH "NewFlightDialog" 3 "Tue Jul 27 2021" "openPilotLog" \" -*- nroff -*-.ad l.nh.SH NAMENewFlightDialog.SH SYNOPSIS.br.PP.PPInherits QDialog\&..SS "Public Member Functions".in +1c.ti -1c.RI "\fBNewFlightDialog\fP (QWidget *parent=nullptr)".br.RI "\fBNewFlightDialog\fP create a new flight and add it to the logbook\&. ".ti -1c.RI "\fBNewFlightDialog\fP (int row_id, QWidget *parent=nullptr)".br.RI "\fBNewFlightDialog\fP Edit an existing logbook entry\&. ".in -1c.SH "Constructor & Destructor Documentation".PP .SS "NewFlightDialog::NewFlightDialog (QWidget * parent = \fCnullptr\fP)\fC [explicit]\fP".PP\fBNewFlightDialog\fP create a new flight and add it to the logbook\&. Construction ///\&..PP[F] The general idea for this dialog is this:.IP "\(bu" 2Most line edits have validators and completers\&..IP "\(bu" 2Validators are based on regular expressions, serving as raw input validation.IP "\(bu" 2The Completers are based off the database and provide auto-completion.IP "\(bu" 2mandatory line edits only emit editing finished if their content has passed raw input validation or focus is lost\&..IP "\(bu" 2Editing finished triggers validating inputs by mapping them to Database values where required and results in either pass or fail\&..IP "\(bu" 2A QBitArray is mainained containing the state of validity of the mandatory line edits.IP "\(bu" 2The deducted entries are automatically filled if all mandatory entries are valid\&..IP "\(bu" 2Comitting an entry to the database is only allowed if all mandatory inputs are valid\&..PP.PPif the user presses 'OK', check if all mandatory inputs are valid, check if optional user inputs are valid and commit\&..PPFor the completion and mapping, I have settled on a more low-level approach using Completers based on QStringLists and mapping with QMaps\&..PPI 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\&. .SH "Author".PP Generated automatically by Doxygen for openPilotLog from the source code\&.
 |