123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.9.1"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>openPilotLog: NewFlightDialog Class Reference</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- <link href="custom_dark_theme.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectlogo"><img alt="Logo" src="icon_main.png"/></td>
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">openPilotLog
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.9.1 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
- /* @license-end */
- </script>
- <script type="text/javascript" src="menudata.js"></script>
- <script type="text/javascript" src="menu.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(function() {
- initMenu('',true,false,'search.php','Search');
- $(document).ready(function() { init_search(); });
- });
- /* @license-end */</script>
- <div id="main-nav"></div>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function(){initNavTree('class_new_flight_dialog.html',''); initResizable(); });
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="summary">
- <a href="#pub-methods">Public Member Functions</a> |
- <a href="#pro-methods">Protected Member Functions</a> |
- <a href="class_new_flight_dialog-members.html">List of all members</a> </div>
- <div class="headertitle">
- <div class="title">NewFlightDialog Class Reference</div> </div>
- </div><!--header-->
- <div class="contents">
- <p>The <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> is used to add or edit entries from the flights table in the database.
- <a href="class_new_flight_dialog.html#details">More...</a></p>
- <p><code>#include <<a class="el" href="newflightdialog_8h_source.html">newflightdialog.h</a>></code></p>
- <div class="dynheader">
- Inheritance diagram for NewFlightDialog:</div>
- <div class="dyncontent">
- <div class="center">
- <img src="class_new_flight_dialog.png" alt=""/>
- </div></div>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
- Public Member Functions</h2></td></tr>
- <tr class="memitem:abb96717e143dac3ea5f3d7f11fc30a5b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_new_flight_dialog.html#abb96717e143dac3ea5f3d7f11fc30a5b">NewFlightDialog</a> (<a class="el" href="class_o_p_l_1_1_db_completion_data.html">OPL::DbCompletionData</a> &completion_data, QWidget *parent=nullptr)</td></tr>
- <tr class="memdesc:abb96717e143dac3ea5f3d7f11fc30a5b"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> - Creates a <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> that can be used to add a new flight entry to the logbook. <a href="class_new_flight_dialog.html#abb96717e143dac3ea5f3d7f11fc30a5b">More...</a><br /></td></tr>
- <tr class="separator:abb96717e143dac3ea5f3d7f11fc30a5b"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a6743b82918ae8af325723c86bdf31688"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_new_flight_dialog.html#a6743b82918ae8af325723c86bdf31688">NewFlightDialog</a> (<a class="el" href="class_o_p_l_1_1_db_completion_data.html">OPL::DbCompletionData</a> &completion_data, int row_id, QWidget *parent=nullptr)</td></tr>
- <tr class="memdesc:a6743b82918ae8af325723c86bdf31688"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> - Creates a <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> that can be used to edit an existing entry in the logbook. <a href="class_new_flight_dialog.html#a6743b82918ae8af325723c86bdf31688">More...</a><br /></td></tr>
- <tr class="separator:a6743b82918ae8af325723c86bdf31688"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
- Protected Member Functions</h2></td></tr>
- <tr class="memitem:a22f8f768399ceb22f064fb8cb24c3c28"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_new_flight_dialog.html#a22f8f768399ceb22f064fb8cb24c3c28">eventFilter</a> (QObject *object, QEvent *event) override</td></tr>
- <tr class="memdesc:a22f8f768399ceb22f064fb8cb24c3c28"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="class_new_flight_dialog.html#a22f8f768399ceb22f064fb8cb24c3c28" title="NewFlightDialog::eventFilter invalidates mandatory line edits on focus in.">NewFlightDialog::eventFilter</a> invalidates mandatory line edits on focus in. <a href="class_new_flight_dialog.html#a22f8f768399ceb22f064fb8cb24c3c28">More...</a><br /></td></tr>
- <tr class="separator:a22f8f768399ceb22f064fb8cb24c3c28"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
- <div class="textblock"><p>The <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> is used to add or edit entries from the flights table in the database. </p>
- <p><a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> offers two constructors, one is used to create a new flight entry from scratch, where the other one is used to edit an existing entry. This entry is identified by its ROW ID, which is used to retreive the entry data and pre-populate the user interface with the data from the database.</p>
- <p>The flights table is the core of the application's database and care needs to be taken when interfacing with it.</p>
- <p>To ensure only good data is written to the database, the <a class="el" href="class_validation_state.html" title="The ValidationState class encapsulates a QBitArray that has a bit set (or unset) depending on wether ...">ValidationState</a> class is used. It contains a QBitArray with each bit representing a mandatory data point. The array is initialized to all false and progressively changed to true as entry data is validated. An entry can only be submitted if all the verification bits are set.</p>
- <p>Inputs from the user are verified with a two-step process. The first level of verification is accomplished by QRegularExpressionValidator, which limits the user to only inputting generally acceptable data (like numbers for date or time, or characters for airport identifiers). If the input passes this sanity check, the line edits emit the editingFinished() signal, which triggers a more granular and sophisticated set of input verification, broadly based on cross-checking the entered data against known good values. The ACompletionData class is used to provide QHashs of known good values from the database and their respective ROW_IDs. If user-entered data has been matched to a known good database value, the data is considered acceptable. This means that in order to, for example, log a flight with a certain Pilot, that this pilot already has to exist in the pilots table. If this is not the case, the user is prompted to add a new pilot (or aircraft) to the database before proceeding. In order to make this matching process seamless for the user, the completionData also contains a set of QStringLists for each of the database tables which are used to create QCompleters that provide pop-up completion on the respective QLineEdits.</p>
- <p>Once the user is satisfied with his entries, a final set of input verification is triggered and the entry is submitted to the database, see on_buttonBox_accepted() and Database::commit() </p>
- </div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
- <a id="abb96717e143dac3ea5f3d7f11fc30a5b"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#abb96717e143dac3ea5f3d7f11fc30a5b">◆ </a></span>NewFlightDialog() <span class="overload">[1/2]</span></h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">NewFlightDialog::NewFlightDialog </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="class_o_p_l_1_1_db_completion_data.html">OPL::DbCompletionData</a> & </td>
- <td class="paramname"><em>completion_data</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">QWidget * </td>
- <td class="paramname"><em>parent</em> = <code>nullptr</code> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">explicit</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p><a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> - Creates a <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> that can be used to add a new flight entry to the logbook. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">completion_data</td><td>- contains QStringLists for the QCompleter to autocomplete Airport Codes, Pilot Names and aircraft registrationsn </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <a id="a6743b82918ae8af325723c86bdf31688"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a6743b82918ae8af325723c86bdf31688">◆ </a></span>NewFlightDialog() <span class="overload">[2/2]</span></h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">NewFlightDialog::NewFlightDialog </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="class_o_p_l_1_1_db_completion_data.html">OPL::DbCompletionData</a> & </td>
- <td class="paramname"><em>completion_data</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>row_id</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">QWidget * </td>
- <td class="paramname"><em>parent</em> = <code>nullptr</code> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">explicit</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p><a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> - Creates a <a class="el" href="class_new_flight_dialog.html" title="The NewFlightDialog is used to add or edit entries from the flights table in the database.">NewFlightDialog</a> that can be used to edit an existing entry in the logbook. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">completion_data</td><td>- contains QStringLists for the QCompleter to autocomplete Airport Codes, Pilot Names and aircraft registrationsn </td></tr>
- <tr><td class="paramname">row_id</td><td>- The database ROW ID of the entry to be edited </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <h2 class="groupheader">Member Function Documentation</h2>
- <a id="a22f8f768399ceb22f064fb8cb24c3c28"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a22f8f768399ceb22f064fb8cb24c3c28">◆ </a></span>eventFilter()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">bool NewFlightDialog::eventFilter </td>
- <td>(</td>
- <td class="paramtype">QObject * </td>
- <td class="paramname"><em>object</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">QEvent * </td>
- <td class="paramname"><em>event</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">protected</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p><a class="el" href="class_new_flight_dialog.html#a22f8f768399ceb22f064fb8cb24c3c28" title="NewFlightDialog::eventFilter invalidates mandatory line edits on focus in.">NewFlightDialog::eventFilter</a> invalidates mandatory line edits on focus in. </p>
- <p>Some of the QLineEdits have validators set that provide raw input validation. These validators have the side effect that if an input does not meet the raw input validation criteria, onEditingFinished() is not emitted when the line edit loses focus. This could lead to a line edit that previously had good input to be changed to bad input without the validation bit in validationState being unset, because the second step of input validation is only triggered when editingFinished() is emitted. </p>
- </div>
- </div>
- <hr/>The documentation for this class was generated from the following files:<ul>
- <li>src/gui/dialogues/<a class="el" href="newflightdialog_8h_source.html">newflightdialog.h</a></li>
- <li>src/gui/dialogues/newflightdialog.cpp</li>
- </ul>
- </div><!-- contents -->
- </div><!-- doc-content -->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="class_new_flight_dialog.html">NewFlightDialog</a></li>
- <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
- </ul>
- </div>
- </body>
- </html>
|