class_new_flight_dialog.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.18"/>
  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="projectlogo"><img alt="Logo" src="icon_main.png"/></td>
  29. <td id="projectalign" style="padding-left: 0.5em;">
  30. <div id="projectname">openPilotLog
  31. </div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.8.18 -->
  39. <script type="text/javascript">
  40. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  41. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  42. /* @license-end */
  43. </script>
  44. <script type="text/javascript" src="menudata.js"></script>
  45. <script type="text/javascript" src="menu.js"></script>
  46. <script type="text/javascript">
  47. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  48. $(function() {
  49. initMenu('',true,false,'search.php','Search');
  50. $(document).ready(function() { init_search(); });
  51. });
  52. /* @license-end */</script>
  53. <div id="main-nav"></div>
  54. </div><!-- top -->
  55. <div id="side-nav" class="ui-resizable side-nav-resizable">
  56. <div id="nav-tree">
  57. <div id="nav-tree-contents">
  58. <div id="nav-sync" class="sync"></div>
  59. </div>
  60. </div>
  61. <div id="splitbar" style="-moz-user-select:none;"
  62. class="ui-resizable-handle">
  63. </div>
  64. </div>
  65. <script type="text/javascript">
  66. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  67. $(document).ready(function(){initNavTree('class_new_flight_dialog.html',''); initResizable(); });
  68. /* @license-end */
  69. </script>
  70. <div id="doc-content">
  71. <!-- window showing the filter options -->
  72. <div id="MSearchSelectWindow"
  73. onmouseover="return searchBox.OnSearchSelectShow()"
  74. onmouseout="return searchBox.OnSearchSelectHide()"
  75. onkeydown="return searchBox.OnSearchSelectKey(event)">
  76. </div>
  77. <!-- iframe showing the search results (closed by default) -->
  78. <div id="MSearchResultsWindow">
  79. <iframe src="javascript:void(0)" frameborder="0"
  80. name="MSearchResults" id="MSearchResults">
  81. </iframe>
  82. </div>
  83. <div class="header">
  84. <div class="summary">
  85. <a href="#nested-classes">Classes</a> &#124;
  86. <a href="#pub-methods">Public Member Functions</a> &#124;
  87. <a href="class_new_flight_dialog-members.html">List of all members</a> </div>
  88. <div class="headertitle">
  89. <div class="title">NewFlightDialog Class Reference</div> </div>
  90. </div><!--header-->
  91. <div class="contents">
  92. <div class="dynheader">
  93. Inheritance diagram for NewFlightDialog:</div>
  94. <div class="dyncontent">
  95. <div class="center">
  96. <img src="class_new_flight_dialog.png" alt=""/>
  97. </div></div>
  98. <table class="memberdecls">
  99. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  100. Public Member Functions</h2></td></tr>
  101. <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>
  102. <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>
  103. <tr class="separator:a28d14d3bf3c2a283c43456a25d97899d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  104. <tr class="memitem:ad60b284ebebae287c00f0c9f30105f28"><td class="memItemLeft" align="right" valign="top"><a id="ad60b284ebebae287c00f0c9f30105f28"></a>
  105. &#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>
  106. <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>
  107. <tr class="separator:ad60b284ebebae287c00f0c9f30105f28"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. </table>
  109. <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  110. <a id="a28d14d3bf3c2a283c43456a25d97899d"></a>
  111. <h2 class="memtitle"><span class="permalink"><a href="#a28d14d3bf3c2a283c43456a25d97899d">&#9670;&nbsp;</a></span>NewFlightDialog()</h2>
  112. <div class="memitem">
  113. <div class="memproto">
  114. <table class="mlabels">
  115. <tr>
  116. <td class="mlabels-left">
  117. <table class="memname">
  118. <tr>
  119. <td class="memname">NewFlightDialog::NewFlightDialog </td>
  120. <td>(</td>
  121. <td class="paramtype">QWidget *&#160;</td>
  122. <td class="paramname"><em>parent</em> = <code>nullptr</code></td><td>)</td>
  123. <td></td>
  124. </tr>
  125. </table>
  126. </td>
  127. <td class="mlabels-right">
  128. <span class="mlabels"><span class="mlabel">explicit</span></span> </td>
  129. </tr>
  130. </table>
  131. </div><div class="memdoc">
  132. <p><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a> create a new flight and add it to the logbook. </p>
  133. <p>Construction ///.</p>
  134. <p>[F] The general idea for this dialog is this:</p><ul>
  135. <li>Most line edits have validators and completers.</li>
  136. <li>Validators are based on regular expressions, serving as raw input validation</li>
  137. <li>The Completers are based off the database and provide auto-completion</li>
  138. <li>mandatory line edits only emit editing finished if their content has passed raw input validation or focus is lost.</li>
  139. <li>Editing finished triggers validating inputs by mapping them to Database values where required and results in either pass or fail.</li>
  140. <li>A QBitArray is mainained containing the state of validity of the mandatory line edits</li>
  141. <li>The deducted entries are automatically filled if all mandatory entries are valid.</li>
  142. <li>Comitting an entry to the database is only allowed if all mandatory inputs are valid.</li>
  143. </ul>
  144. <p>if the user presses "OK", check if all mandatory inputs are valid, check if optional user inputs are valid and commit.</p>
  145. <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>
  146. <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>
  147. </div>
  148. </div>
  149. <hr/>The documentation for this class was generated from the following files:<ul>
  150. <li>src/gui/dialogues/<a class="el" href="newflightdialog_8h_source.html">newflightdialog.h</a></li>
  151. <li>src/gui/dialogues/newflightdialog.cpp</li>
  152. </ul>
  153. </div><!-- contents -->
  154. </div><!-- doc-content -->
  155. <!-- start footer part -->
  156. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  157. <ul>
  158. <li class="navelem"><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a></li>
  159. <li class="footer">Generated by
  160. <a href="http://www.doxygen.org/index.html">
  161. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
  162. </ul>
  163. </div>
  164. </body>
  165. </html>