[8af59c4aa3] | 1 | <!-- This comment will put IE 6, 7 and 8 in quirks mode --> |
---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
| 4 | <head> |
---|
| 5 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
---|
| 6 | <title>TSPSG: TSP Solver and Generator: src/mainwindow.h Source File</title> |
---|
| 7 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
---|
| 8 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
---|
| 9 | <script type="text/javaScript" src="search/search.js"></script> |
---|
| 10 | <link href="doxygen.css" rel="stylesheet" type="text/css"/> |
---|
| 11 | </head> |
---|
| 12 | <body onload='searchBox.OnSelectItem(0);'> |
---|
| 13 | <!-- Generated by Doxygen 1.6.1 --> |
---|
| 14 | <script type="text/javascript"><!-- |
---|
| 15 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
---|
| 16 | --></script> |
---|
| 17 | <script type="text/javascript"> |
---|
| 18 | <!-- |
---|
| 19 | function changeDisplayState (e){ |
---|
| 20 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
| 21 | var button=this.firstChild; |
---|
| 22 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
| 23 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
| 24 | sectionDiv.style.display='block'; |
---|
| 25 | button.src='open.gif'; |
---|
| 26 | }else{ |
---|
| 27 | sectionDiv.style.display='none'; |
---|
| 28 | button.src='closed.gif'; |
---|
| 29 | } |
---|
| 30 | } |
---|
| 31 | function initDynSections(){ |
---|
| 32 | var divs=document.getElementsByTagName('div'); |
---|
| 33 | var sectionCounter=1; |
---|
| 34 | for(var i=0;i<divs.length-1;i++){ |
---|
| 35 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
| 36 | var header=divs[i]; |
---|
| 37 | var section=divs[i+1]; |
---|
| 38 | var button=header.firstChild; |
---|
| 39 | if (button!='IMG'){ |
---|
| 40 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
| 41 | button=document.createElement('img'); |
---|
| 42 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
| 43 | } |
---|
| 44 | header.style.cursor='pointer'; |
---|
| 45 | header.onclick=changeDisplayState; |
---|
| 46 | header.id='dynheader'+sectionCounter; |
---|
| 47 | button.src='closed.gif'; |
---|
| 48 | section.id='dynsection'+sectionCounter; |
---|
| 49 | section.style.display='none'; |
---|
| 50 | section.style.marginLeft='14px'; |
---|
| 51 | sectionCounter++; |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | window.onload = initDynSections; |
---|
| 56 | --> |
---|
| 57 | </script> |
---|
| 58 | <div class="navigation" id="top"> |
---|
| 59 | <div class="tabs"> |
---|
| 60 | <ul> |
---|
| 61 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
| 62 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
| 63 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
| 64 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
| 65 | <li> |
---|
| 66 | <div id="MSearchBox" class="MSearchBoxInactive"> |
---|
| 67 | <img id="MSearchSelect" src="search/search.png" |
---|
| 68 | onmouseover="return searchBox.OnSearchSelectShow()" |
---|
| 69 | onmouseout="return searchBox.OnSearchSelectHide()" |
---|
| 70 | alt=""/> |
---|
| 71 | <input type="text" id="MSearchField" value="Search" accesskey="S" |
---|
| 72 | onfocus="searchBox.OnSearchFieldFocus(true)" |
---|
| 73 | onblur="searchBox.OnSearchFieldFocus(false)" |
---|
| 74 | onkeyup="searchBox.OnSearchFieldChange(event)"/> |
---|
| 75 | <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
---|
| 76 | </div> |
---|
| 77 | </li> |
---|
| 78 | </ul> |
---|
| 79 | </div> |
---|
| 80 | <div class="tabs"> |
---|
| 81 | <ul> |
---|
| 82 | <li><a href="files.html"><span>File List</span></a></li> |
---|
| 83 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
| 84 | </ul> |
---|
| 85 | </div> |
---|
| 86 | <h1>src/mainwindow.h</h1><a href="mainwindow_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
| 87 | <a name="l00028"></a>00028 <span class="preprocessor">#ifndef MAINWINDOW_H</span> |
---|
| 88 | <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define MAINWINDOW_H</span> |
---|
| 89 | <a name="l00030"></a>00030 <span class="preprocessor"></span> |
---|
| 90 | <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="globals_8h.html" title="Contains TSPSG global defines.">globals.h</a>"</span> |
---|
| 91 | <a name="l00032"></a>00032 |
---|
| 92 | <a name="l00033"></a>00033 <span class="preprocessor">#include "ui_mainwindow.h"</span> |
---|
| 93 | <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="settingsdialog_8h.html" title="Defines SettingsDialog class.">settingsdialog.h</a>"</span> |
---|
| 94 | <a name="l00035"></a>00035 |
---|
[fcaa74f7d7] | 95 | <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="tspsolver_8h.html" title="Defines TMatrix typedef, SCandidate and SStep structs and CTSPSolver class.">tspsolver.h</a>"</span> |
---|
[8af59c4aa3] | 96 | <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="tspmodel_8h.html" title="Defines CTSPModel class.">tspmodel.h</a>"</span> |
---|
| 97 | <a name="l00038"></a>00038 |
---|
[a218bf2cb2] | 98 | <a name="l00043"></a><a class="code" href="class_main_window.html">00043</a> <span class="keyword">class </span><a class="code" href="class_main_window.html" title="Class for handling Main Window UI and logic.">MainWindow</a>: <span class="keyword">public</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmainwindow.html">QMainWindow</a>, Ui::<a class="code" href="class_main_window.html" title="Class for handling Main Window UI and logic.">MainWindow</a> |
---|
[8af59c4aa3] | 99 | <a name="l00044"></a>00044 { |
---|
| 100 | <a name="l00045"></a>00045 Q_OBJECT |
---|
| 101 | <a name="l00046"></a>00046 |
---|
| 102 | <a name="l00047"></a>00047 <span class="keyword">public</span>: |
---|
[a218bf2cb2] | 103 | <a name="l00048"></a>00048 <a class="code" href="class_main_window.html#a8b244be8b7b7db1b08de2a2acb9409db" title="Class constructor.">MainWindow</a>(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qwidget.html">QWidget</a> *parent = 0); |
---|
| 104 | <a name="l00049"></a>00049 |
---|
| 105 | <a name="l00050"></a>00050 <span class="keyword">private</span> slots: |
---|
| 106 | <a name="l00051"></a>00051 <span class="comment">// Actions</span> |
---|
| 107 | <a name="l00052"></a>00052 <span class="keywordtype">void</span> actionFileNewTriggered(); |
---|
| 108 | <a name="l00053"></a>00053 <span class="keywordtype">void</span> actionFileOpenTriggered(); |
---|
| 109 | <a name="l00054"></a>00054 <span class="keywordtype">void</span> actionFileSaveTriggered(); |
---|
| 110 | <a name="l00055"></a>00055 <span class="keywordtype">void</span> actionFileSaveAsTaskTriggered(); |
---|
| 111 | <a name="l00056"></a>00056 <span class="keywordtype">void</span> actionFileSaveAsSolutionTriggered(); |
---|
| 112 | <a name="l00057"></a>00057 <span class="preprocessor">#ifndef QT_NO_PRINTER</span> |
---|
| 113 | <a name="l00058"></a>00058 <span class="preprocessor"></span> <span class="keywordtype">void</span> actionFilePrintPreviewTriggered(); |
---|
| 114 | <a name="l00059"></a>00059 <span class="keywordtype">void</span> actionFilePrintTriggered(); |
---|
| 115 | <a name="l00060"></a>00060 <span class="preprocessor">#endif // QT_NO_PRINTER</span> |
---|
| 116 | <a name="l00061"></a>00061 <span class="preprocessor"></span> <span class="keywordtype">void</span> actionSettingsPreferencesTriggered(); |
---|
| 117 | <a name="l00062"></a>00062 <span class="keywordtype">void</span> actionSettingsLanguageAutodetectTriggered(<span class="keywordtype">bool</span> checked); |
---|
| 118 | <a name="l00063"></a>00063 <span class="keywordtype">void</span> groupSettingsLanguageListTriggered(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qaction.html">QAction</a> *action); |
---|
| 119 | <a name="l00064"></a>00064 <span class="keywordtype">void</span> actionHelpAboutTriggered(); |
---|
| 120 | <a name="l00065"></a>00065 <span class="comment">// Buttons</span> |
---|
| 121 | <a name="l00066"></a>00066 <span class="keywordtype">void</span> buttonBackToTaskClicked(); |
---|
| 122 | <a name="l00067"></a>00067 <span class="keywordtype">void</span> buttonRandomClicked(); |
---|
| 123 | <a name="l00068"></a>00068 <span class="keywordtype">void</span> buttonSolveClicked(); |
---|
| 124 | <a name="l00069"></a>00069 |
---|
| 125 | <a name="l00070"></a>00070 <span class="keywordtype">void</span> dataChanged(); |
---|
| 126 | <a name="l00071"></a>00071 <span class="keywordtype">void</span> dataChanged(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &tl, <span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmodelindex.html">QModelIndex</a> &br); |
---|
| 127 | <a name="l00072"></a>00072 <span class="keywordtype">void</span> numCitiesChanged(<span class="keywordtype">int</span> nCities); |
---|
| 128 | <a name="l00073"></a>00073 <span class="preprocessor">#ifndef QT_NO_PRINTER</span> |
---|
| 129 | <a name="l00074"></a>00074 <span class="preprocessor"></span> <span class="keywordtype">void</span> printPreview(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qprinter.html">QPrinter</a> *printer); |
---|
| 130 | <a name="l00075"></a>00075 <span class="preprocessor">#endif // QT_NO_PRINTER</span> |
---|
| 131 | <a name="l00076"></a>00076 <span class="preprocessor"></span> <span class="keywordtype">void</span> spinCitiesValueChanged(<span class="keywordtype">int</span> nCities); |
---|
| 132 | <a name="l00077"></a>00077 |
---|
| 133 | <a name="l00078"></a>00078 <span class="keyword">private</span>: |
---|
| 134 | <a name="l00079"></a>00079 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> fileName; |
---|
| 135 | <a name="l00080"></a>00080 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qactiongroup.html">QActionGroup</a> *groupSettingsLanguageList; |
---|
| 136 | <a name="l00081"></a>00081 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstringlist.html">QStringList</a> output; |
---|
| 137 | <a name="l00082"></a>00082 <span class="preprocessor">#ifndef QT_NO_PRINTER</span> |
---|
| 138 | <a name="l00083"></a>00083 <span class="preprocessor"></span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qprinter.html">QPrinter</a> *printer; |
---|
| 139 | <a name="l00084"></a>00084 <span class="preprocessor">#endif // QT_NO_PRINTER</span> |
---|
| 140 | <a name="l00085"></a>00085 <span class="preprocessor"></span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qsettings.html">QSettings</a> *settings; |
---|
| 141 | <a name="l00086"></a>00086 <a class="code" href="class_c_t_s_p_model.html" title="This class implements table model for manipulating a task.">CTSPModel</a> *tspmodel; |
---|
| 142 | <a name="l00087"></a>00087 |
---|
| 143 | <a name="l00088"></a>00088 <span class="keywordtype">void</span> closeEvent(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qcloseevent.html">QCloseEvent</a> *ev); |
---|
[8af59c4aa3] | 144 | <a name="l00089"></a>00089 <span class="keywordtype">void</span> enableSolutionActions(<span class="keywordtype">bool</span> enable = <span class="keyword">true</span>); |
---|
| 145 | <a name="l00090"></a>00090 <span class="keywordtype">void</span> initDocStyleSheet(); |
---|
| 146 | <a name="l00091"></a>00091 <span class="keywordtype">void</span> loadLangList(); |
---|
[a218bf2cb2] | 147 | <a name="l00092"></a>00092 <span class="keywordtype">bool</span> loadLanguage(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> &lang = <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a>()); |
---|
[8af59c4aa3] | 148 | <a name="l00093"></a>00093 <span class="keywordtype">bool</span> maybeSave(); |
---|
[fcaa74f7d7] | 149 | <a name="l00094"></a>00094 <span class="keywordtype">void</span> outputMatrix(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &matrix, <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstringlist.html">QStringList</a> &output); |
---|
| 150 | <a name="l00095"></a>00095 <span class="keywordtype">void</span> outputMatrix(<span class="keyword">const</span> <a class="code" href="struct_s_step.html" title="This structure represents one step of solving.">SStep</a> &step, <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstringlist.html">QStringList</a> &output); |
---|
| 151 | <a name="l00096"></a>00096 <span class="keywordtype">bool</span> saveTask(); |
---|
| 152 | <a name="l00097"></a>00097 <span class="keywordtype">void</span> setFileName(<span class="keyword">const</span> <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> &fileName = trUtf8(<span class="stringliteral">"Untitled"</span>) + <span class="stringliteral">".tspt"</span>); |
---|
| 153 | <a name="l00098"></a>00098 }; |
---|
| 154 | <a name="l00099"></a>00099 |
---|
| 155 | <a name="l00100"></a>00100 <span class="preprocessor">#endif // MAINWINDOW_H</span> |
---|
[8af59c4aa3] | 156 | </pre></div></div> |
---|
| 157 | <!--- window showing the filter options --> |
---|
| 158 | <div id="MSearchSelectWindow" |
---|
| 159 | onmouseover="return searchBox.OnSearchSelectShow()" |
---|
| 160 | onmouseout="return searchBox.OnSearchSelectHide()" |
---|
| 161 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
---|
| 162 | <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Defines</a></div> |
---|
| 163 | |
---|
| 164 | <!-- iframe showing the search results (closed by default) --> |
---|
| 165 | <div id="MSearchResultsWindow"> |
---|
| 166 | <iframe src="" frameborder="0" |
---|
| 167 | name="MSearchResults" id="MSearchResults"> |
---|
| 168 | </iframe> |
---|
| 169 | </div> |
---|
| 170 | |
---|
[fcaa74f7d7] | 171 | <hr size="1"/><address style="text-align: right;"><small>Generated on Thu Dec 17 00:37:27 2009 for TSPSG: TSP Solver and Generator by |
---|
[8af59c4aa3] | 172 | <a href="http://www.doxygen.org/index.html"> |
---|
| 173 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> |
---|
| 174 | </body> |
---|
| 175 | </html> |
---|