class_new_flight_dialog.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.20"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>openPilotLog: NewFlightDialog Class Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  17. <script type="text/javascript" src="search/searchdata.js"></script>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. <link href="custom_dark_theme.css" rel="stylesheet" type="text/css"/>
  21. </head>
  22. <body>
  23. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  24. <div id="titlearea">
  25. <table cellspacing="0" cellpadding="0">
  26. <tbody>
  27. <tr style="height: 56px;">
  28. <td id="projectalign" style="padding-left: 0.5em;">
  29. <div id="projectname">openPilotLog
  30. </div>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. <!-- end header part -->
  37. <!-- Generated by Doxygen 1.8.20 -->
  38. <script type="text/javascript">
  39. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. /* @license-end */
  42. </script>
  43. <script type="text/javascript" src="menudata.js"></script>
  44. <script type="text/javascript" src="menu.js"></script>
  45. <script type="text/javascript">
  46. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  47. $(function() {
  48. initMenu('',true,false,'search.php','Search');
  49. $(document).ready(function() { init_search(); });
  50. });
  51. /* @license-end */</script>
  52. <div id="main-nav"></div>
  53. </div><!-- top -->
  54. <div id="side-nav" class="ui-resizable side-nav-resizable">
  55. <div id="nav-tree">
  56. <div id="nav-tree-contents">
  57. <div id="nav-sync" class="sync"></div>
  58. </div>
  59. </div>
  60. <div id="splitbar" style="-moz-user-select:none;"
  61. class="ui-resizable-handle">
  62. </div>
  63. </div>
  64. <script type="text/javascript">
  65. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  66. $(document).ready(function(){initNavTree('class_new_flight_dialog.html',''); initResizable(); });
  67. /* @license-end */
  68. </script>
  69. <div id="doc-content">
  70. <!-- window showing the filter options -->
  71. <div id="MSearchSelectWindow"
  72. onmouseover="return searchBox.OnSearchSelectShow()"
  73. onmouseout="return searchBox.OnSearchSelectHide()"
  74. onkeydown="return searchBox.OnSearchSelectKey(event)">
  75. </div>
  76. <!-- iframe showing the search results (closed by default) -->
  77. <div id="MSearchResultsWindow">
  78. <iframe src="javascript:void(0)" frameborder="0"
  79. name="MSearchResults" id="MSearchResults">
  80. </iframe>
  81. </div>
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-methods">Public Member Functions</a> &#124;
  85. <a href="class_new_flight_dialog-members.html">List of all members</a> </div>
  86. <div class="headertitle">
  87. <div class="title">NewFlightDialog Class Reference</div> </div>
  88. </div><!--header-->
  89. <div class="contents">
  90. <div class="dynheader">
  91. Inheritance diagram for NewFlightDialog:</div>
  92. <div class="dyncontent">
  93. <div class="center">
  94. <img src="class_new_flight_dialog.png" alt=""/>
  95. </div></div>
  96. <table class="memberdecls">
  97. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  98. Public Member Functions</h2></td></tr>
  99. <tr class="memitem:a28d14d3bf3c2a283c43456a25d97899d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_new_flight_dialog.html#a28d14d3bf3c2a283c43456a25d97899d">NewFlightDialog</a> (QWidget *parent=nullptr)</td></tr>
  100. <tr class="memdesc:a28d14d3bf3c2a283c43456a25d97899d"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a> create a new flight and add it to the logbook. <a href="class_new_flight_dialog.html#a28d14d3bf3c2a283c43456a25d97899d">More...</a><br /></td></tr>
  101. <tr class="separator:a28d14d3bf3c2a283c43456a25d97899d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. <tr class="memitem:ad60b284ebebae287c00f0c9f30105f28"><td class="memItemLeft" align="right" valign="top"><a id="ad60b284ebebae287c00f0c9f30105f28"></a>
  103. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_new_flight_dialog.html#ad60b284ebebae287c00f0c9f30105f28">NewFlightDialog</a> (int row_id, QWidget *parent=nullptr)</td></tr>
  104. <tr class="memdesc:ad60b284ebebae287c00f0c9f30105f28"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a> Edit an existing logbook entry. <br /></td></tr>
  105. <tr class="separator:ad60b284ebebae287c00f0c9f30105f28"><td class="memSeparator" colspan="2">&#160;</td></tr>
  106. </table>
  107. <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  108. <a id="a28d14d3bf3c2a283c43456a25d97899d"></a>
  109. <h2 class="memtitle"><span class="permalink"><a href="#a28d14d3bf3c2a283c43456a25d97899d">&#9670;&nbsp;</a></span>NewFlightDialog()</h2>
  110. <div class="memitem">
  111. <div class="memproto">
  112. <table class="mlabels">
  113. <tr>
  114. <td class="mlabels-left">
  115. <table class="memname">
  116. <tr>
  117. <td class="memname">NewFlightDialog::NewFlightDialog </td>
  118. <td>(</td>
  119. <td class="paramtype">QWidget *&#160;</td>
  120. <td class="paramname"><em>parent</em> = <code>nullptr</code></td><td>)</td>
  121. <td></td>
  122. </tr>
  123. </table>
  124. </td>
  125. <td class="mlabels-right">
  126. <span class="mlabels"><span class="mlabel">explicit</span></span> </td>
  127. </tr>
  128. </table>
  129. </div><div class="memdoc">
  130. <p><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a> create a new flight and add it to the logbook. </p>
  131. <p>Construction ///.</p>
  132. <p>[F] The general idea for this dialog is this:</p><ul>
  133. <li>Most line edits have validators and completers.</li>
  134. <li>Validators are based on regular expressions, serving as raw input validation</li>
  135. <li>The Completers are based off the database and provide auto-completion</li>
  136. <li>mandatory line edits only emit editing finished if their content has passed raw input validation or focus is lost.</li>
  137. <li>Editing finished triggers validating inputs by mapping them to Database values where required and results in either pass or fail.</li>
  138. <li>A QBitArray is mainained containing the state of validity of the mandatory line edits</li>
  139. <li>The deducted entries are automatically filled if all mandatory entries are valid.</li>
  140. <li>Comitting an entry to the database is only allowed if all mandatory inputs are valid.</li>
  141. </ul>
  142. <p>if the user presses "OK", check if all mandatory inputs are valid, check if optional user inputs are valid and commit.</p>
  143. <p>For the completion and mapping, I have settled on a more low-level approach using Completers based on QStringLists and mapping with QMaps.</p>
  144. <p>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. </p>
  145. </div>
  146. </div>
  147. <hr/>The documentation for this class was generated from the following files:<ul>
  148. <li>src/gui/dialogues/<a class="el" href="newflightdialog_8h_source.html">newflightdialog.h</a></li>
  149. <li>src/gui/dialogues/newflightdialog.cpp</li>
  150. </ul>
  151. </div><!-- contents -->
  152. </div><!-- doc-content -->
  153. <!-- start footer part -->
  154. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  155. <ul>
  156. <li class="navelem"><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a></li>
  157. <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  158. </ul>
  159. </div>
  160. </body>
  161. </html>