2
0

NewFlightDialog.3 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. .TH "NewFlightDialog" 3 "Sun Dec 27 2020" "openPilotLog" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. NewFlightDialog
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. Inherits QDialog\&.
  11. .SS "Public Member Functions"
  12. .in +1c
  13. .ti -1c
  14. .RI "\fBNewFlightDialog\fP (QWidget *parent=nullptr)"
  15. .br
  16. .RI "\fBNewFlightDialog\fP create a new flight and add it to the logbook\&. "
  17. .ti -1c
  18. .RI "\fBNewFlightDialog\fP (int row_id, QWidget *parent=nullptr)"
  19. .br
  20. .RI "\fBNewFlightDialog\fP Edit an existing logbook entry\&. "
  21. .in -1c
  22. .SH "Constructor & Destructor Documentation"
  23. .PP
  24. .SS "NewFlightDialog::NewFlightDialog (QWidget * parent = \fCnullptr\fP)\fC [explicit]\fP"
  25. .PP
  26. \fBNewFlightDialog\fP create a new flight and add it to the logbook\&. Construction ///\&.
  27. .PP
  28. [F] The general idea for this dialog is this:
  29. .IP "\(bu" 2
  30. Most line edits have validators and completers\&.
  31. .IP "\(bu" 2
  32. Validators are based on regular expressions, serving as raw input validation
  33. .IP "\(bu" 2
  34. The Completers are based off the database and provide auto-completion
  35. .IP "\(bu" 2
  36. mandatory line edits only emit editing finished if their content has passed raw input validation or focus is lost\&.
  37. .IP "\(bu" 2
  38. Editing finished triggers validating inputs by mapping them to Database values where required and results in either pass or fail\&.
  39. .IP "\(bu" 2
  40. A QBitArray is mainained containing the state of validity of the mandatory line edits
  41. .IP "\(bu" 2
  42. The deducted entries are automatically filled if all mandatory entries are valid\&.
  43. .IP "\(bu" 2
  44. Comitting an entry to the database is only allowed if all mandatory inputs are valid\&.
  45. .PP
  46. .PP
  47. if the user presses 'OK', check if all mandatory inputs are valid, check if optional user inputs are valid and commit\&.
  48. .PP
  49. For the completion and mapping, I have settled on a more low-level approach using Completers based on QStringLists and mapping with QMaps\&.
  50. .PP
  51. 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\&.
  52. .SH "Author"
  53. .PP
  54. Generated automatically by Doxygen for openPilotLog from the source code\&.