source: tspsg/docs/html/class_c_t_s_p_model.html @ 8af59c4aa3

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since 8af59c4aa3 was 8af59c4aa3, checked in by Oleksii Serdiuk, 15 years ago

Adding documentation generated by doxygen.

  • Property mode set to 100644
File size: 28.4 KB
Line 
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: CTSPModel Class Reference</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"><!--
15var searchBox = new SearchBox("searchBox", "search",false,'Search');
16--></script>
17<script type="text/javascript">
18<!--
19function 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}
31function 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}
55window.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&nbsp;Page</span></a></li>
62      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
63      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
64      <li><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="annotated.html"><span>Class&nbsp;List</span></a></li>
83      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
84    </ul>
85  </div>
86</div>
87<div class="contents">
88<h1>CTSPModel Class Reference</h1><!-- doxytag: class="CTSPModel" -->
89<p>This class implements table model for manipulating a task. 
90<a href="#_details">More...</a></p>
91
92<p><code>#include &lt;<a class="el" href="tspmodel_8h_source.html">tspmodel.h</a>&gt;</code></p>
93
94<p><a href="class_c_t_s_p_model-members.html">List of all members.</a></p>
95<table border="0" cellpadding="0" cellspacing="0">
96<tr><td colspan="2"><h2>Signals</h2></td></tr>
97<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a733908abe1ffabf49ad34ccdabaeeee9">numCitiesChanged</a> (int)</td></tr>
98<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This signal is emitted whenever the number of cities in the task changes.  <a href="#a733908abe1ffabf49ad34ccdabaeeee9"></a><br/></td></tr>
99<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
100<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a50a24986bc34b37c6c3b7bb52371b837">CTSPModel</a> (QObject *parent=0)</td></tr>
101<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class constructor.  <a href="#a50a24986bc34b37c6c3b7bb52371b837"></a><br/></td></tr>
102<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a4944812fdf6d348735db401f966b4f4a">clear</a> ()</td></tr>
103<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets the table, setting all its elements to 0.  <a href="#a4944812fdf6d348735db401f966b4f4a"></a><br/></td></tr>
104<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a94b2639d6b65af914ce17b816ddc3572">columnCount</a> (const QModelIndex &amp;) const </td></tr>
105<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the column count in the table.  <a href="#a94b2639d6b65af914ce17b816ddc3572"></a><br/></td></tr>
106<tr><td class="memItemLeft" align="right" valign="top">QVariant&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#ab8ccba12783303f239f92fe72b48793e">data</a> (const QModelIndex &amp;, int) const </td></tr>
107<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the data stored under the given <em>role</em> for the item referred to by the <em>index</em><a href="#ab8ccba12783303f239f92fe72b48793e"></a><br/></td></tr>
108<tr><td class="memItemLeft" align="right" valign="top">Qt::ItemFlags&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a057b15ee4fc0f8c7b5648188b8173db6">flags</a> (const QModelIndex &amp;) const </td></tr>
109<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the item flags for the given <em>index</em><a href="#a057b15ee4fc0f8c7b5648188b8173db6"></a><br/></td></tr>
110<tr><td class="memItemLeft" align="right" valign="top">QVariant&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a425d9678b2c2c63cf00fabb5643a2615">headerData</a> (int, Qt::Orientation, int) const </td></tr>
111<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the data for the given <em>role</em> and <em>section</em> in the header with the specified <em>orientation</em><a href="#a425d9678b2c2c63cf00fabb5643a2615"></a><br/></td></tr>
112<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#ab2827e0bdb3246ade67df5a09805524a">loadTask</a> (QString)</td></tr>
113<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Loads a task from <em>fname</em><a href="#ab2827e0bdb3246ade67df5a09805524a"></a><br/></td></tr>
114<tr><td class="memItemLeft" align="right" valign="top">quint16&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a4fcde91257e57ba0e9754418cb83148e">numCities</a> () const </td></tr>
115<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of cities.  <a href="#a4fcde91257e57ba0e9754418cb83148e"></a><br/></td></tr>
116<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#ad18e48dd0b0ad56d8e4ae3b1bc039e4a">randomize</a> ()</td></tr>
117<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Randomizes the table by setting all its values to random ones.  <a href="#ad18e48dd0b0ad56d8e4ae3b1bc039e4a"></a><br/></td></tr>
118<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a7f00cebe4cf0fed16f734544c81103f9">rowCount</a> (const QModelIndex &amp;) const </td></tr>
119<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the row count in the table.  <a href="#a7f00cebe4cf0fed16f734544c81103f9"></a><br/></td></tr>
120<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#aae606273bf2ad5d76779e00901d76593">saveTask</a> (QString)</td></tr>
121<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Saves current task to <em>fname</em><a href="#aae606273bf2ad5d76779e00901d76593"></a><br/></td></tr>
122<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a4bb074d84c35fa350a55ca78b41e967f">setData</a> (const QModelIndex &amp;, const QVariant &amp;, int)</td></tr>
123<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the <em>role</em> data for the item at <em>index</em> to <em>value</em><a href="#a4bb074d84c35fa350a55ca78b41e967f"></a><br/></td></tr>
124<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_t_s_p_model.html#a5c485ac77762dbf4e27fb6d8d0664e3c">setNumCities</a> (int)</td></tr>
125<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets number of cities in the current task to <em>n</em><a href="#a5c485ac77762dbf4e27fb6d8d0664e3c"></a><br/></td></tr>
126</table>
127<hr/><a name="_details"></a><h2>Detailed Description</h2>
128<p>This class implements table model for manipulating a task. </p>
129<dl class="author"><dt><b>Author:</b></dt><dd>Copyright &copy; 2007-2009 Lёppa &lt;contacts[at]oleksii[dot]name&gt; </dd></dl>
130<hr/><h2>Constructor &amp; Destructor Documentation</h2>
131<a class="anchor" id="a50a24986bc34b37c6c3b7bb52371b837"></a><!-- doxytag: member="CTSPModel::CTSPModel" ref="a50a24986bc34b37c6c3b7bb52371b837" args="(QObject *parent=0)" -->
132<div class="memitem">
133<div class="memproto">
134      <table class="memname">
135        <tr>
136          <td class="memname">CTSPModel::CTSPModel </td>
137          <td>(</td>
138          <td class="paramtype">QObject *&nbsp;</td>
139          <td class="paramname"> <em>parent</em> = <code>0</code></td>
140          <td>&nbsp;)&nbsp;</td>
141          <td></td>
142        </tr>
143      </table>
144</div>
145<div class="memdoc">
146
147<p>Class constructor. </p>
148<dl><dt><b>Parameters:</b></dt><dd>
149  <table border="0" cellspacing="2" cellpadding="0">
150    <tr><td valign="top"></td><td valign="top"><em>parent</em>&nbsp;</td><td>The parent of the table model. </td></tr>
151  </table>
152  </dd>
153</dl>
154
155</div>
156</div>
157<hr/><h2>Member Function Documentation</h2>
158<a class="anchor" id="a4944812fdf6d348735db401f966b4f4a"></a><!-- doxytag: member="CTSPModel::clear" ref="a4944812fdf6d348735db401f966b4f4a" args="()" -->
159<div class="memitem">
160<div class="memproto">
161      <table class="memname">
162        <tr>
163          <td class="memname">void CTSPModel::clear </td>
164          <td>(</td>
165          <td class="paramname"></td>
166          <td>&nbsp;)&nbsp;</td>
167          <td></td>
168        </tr>
169      </table>
170</div>
171<div class="memdoc">
172
173<p>Resets the table, setting all its elements to 0. </p>
174<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#ad18e48dd0b0ad56d8e4ae3b1bc039e4a" title="Randomizes the table by setting all its values to random ones.">randomize()</a> </dd></dl>
175
176</div>
177</div>
178<a class="anchor" id="a94b2639d6b65af914ce17b816ddc3572"></a><!-- doxytag: member="CTSPModel::columnCount" ref="a94b2639d6b65af914ce17b816ddc3572" args="(const QModelIndex &amp;) const " -->
179<div class="memitem">
180<div class="memproto">
181      <table class="memname">
182        <tr>
183          <td class="memname">int CTSPModel::columnCount </td>
184          <td>(</td>
185          <td class="paramtype">const QModelIndex &amp;&nbsp;</td>
186          <td class="paramname"></td>
187          <td>&nbsp;)&nbsp;</td>
188          <td> const</td>
189        </tr>
190      </table>
191</div>
192<div class="memdoc">
193
194<p>Returns the column count in the table. </p>
195<dl class="return"><dt><b>Returns:</b></dt><dd>Number of columns in the table.</dd></dl>
196<p>Actually, this function returns the number of cities in the current task.</p>
197<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a4fcde91257e57ba0e9754418cb83148e" title="Returns the number of cities.">numCities()</a>, <a class="el" href="class_c_t_s_p_model.html#a7f00cebe4cf0fed16f734544c81103f9" title="Returns the row count in the table.">rowCount()</a> </dd></dl>
198
199</div>
200</div>
201<a class="anchor" id="ab8ccba12783303f239f92fe72b48793e"></a><!-- doxytag: member="CTSPModel::data" ref="ab8ccba12783303f239f92fe72b48793e" args="(const QModelIndex &amp;, int) const " -->
202<div class="memitem">
203<div class="memproto">
204      <table class="memname">
205        <tr>
206          <td class="memname">QVariant CTSPModel::data </td>
207          <td>(</td>
208          <td class="paramtype">const QModelIndex &amp;&nbsp;</td>
209          <td class="paramname"> <em>index</em>, </td>
210        </tr>
211        <tr>
212          <td class="paramkey"></td>
213          <td></td>
214          <td class="paramtype">int&nbsp;</td>
215          <td class="paramname"> <em>role</em></td><td>&nbsp;</td>
216        </tr>
217        <tr>
218          <td></td>
219          <td>)</td>
220          <td></td><td></td><td> const</td>
221        </tr>
222      </table>
223</div>
224<div class="memdoc">
225
226<p>Returns the data stored under the given <em>role</em> for the item referred to by the <em>index</em>. </p>
227<dl><dt><b>Parameters:</b></dt><dd>
228  <table border="0" cellspacing="2" cellpadding="0">
229    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An item index to get data from. </td></tr>
230    <tr><td valign="top"></td><td valign="top"><em>role</em>&nbsp;</td><td>The role to get data for. </td></tr>
231  </table>
232  </dd>
233</dl>
234<dl class="return"><dt><b>Returns:</b></dt><dd>Corresponding data.</dd></dl>
235<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a4bb074d84c35fa350a55ca78b41e967f" title="Sets the role data for the item at index to value.">setData()</a>, <a class="el" href="class_c_t_s_p_model.html#a425d9678b2c2c63cf00fabb5643a2615" title="Returns the data for the given role and section in the header with the specified...">headerData()</a> </dd></dl>
236
237<p><dl class="hacks"><dt><b><a class="el" href="hacks.html#_hacks000001">Hack:</a></b></dt><dd>HACK: Converting to string to prevent spinbox in edit mode </dd></dl>
238</p>
239
240</div>
241</div>
242<a class="anchor" id="a057b15ee4fc0f8c7b5648188b8173db6"></a><!-- doxytag: member="CTSPModel::flags" ref="a057b15ee4fc0f8c7b5648188b8173db6" args="(const QModelIndex &amp;) const " -->
243<div class="memitem">
244<div class="memproto">
245      <table class="memname">
246        <tr>
247          <td class="memname">Qt::ItemFlags CTSPModel::flags </td>
248          <td>(</td>
249          <td class="paramtype">const QModelIndex &amp;&nbsp;</td>
250          <td class="paramname"> <em>index</em></td>
251          <td>&nbsp;)&nbsp;</td>
252          <td> const</td>
253        </tr>
254      </table>
255</div>
256<div class="memdoc">
257
258<p>Returns the item flags for the given <em>index</em>. </p>
259<dl><dt><b>Parameters:</b></dt><dd>
260  <table border="0" cellspacing="2" cellpadding="0">
261    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An item index to get flags from. </td></tr>
262  </table>
263  </dd>
264</dl>
265<dl class="return"><dt><b>Returns:</b></dt><dd>Corresponding item flags. </dd></dl>
266
267</div>
268</div>
269<a class="anchor" id="a425d9678b2c2c63cf00fabb5643a2615"></a><!-- doxytag: member="CTSPModel::headerData" ref="a425d9678b2c2c63cf00fabb5643a2615" args="(int, Qt::Orientation, int) const " -->
270<div class="memitem">
271<div class="memproto">
272      <table class="memname">
273        <tr>
274          <td class="memname">QVariant CTSPModel::headerData </td>
275          <td>(</td>
276          <td class="paramtype">int&nbsp;</td>
277          <td class="paramname"> <em>section</em>, </td>
278        </tr>
279        <tr>
280          <td class="paramkey"></td>
281          <td></td>
282          <td class="paramtype">Qt::Orientation&nbsp;</td>
283          <td class="paramname"> <em>orientation</em>, </td>
284        </tr>
285        <tr>
286          <td class="paramkey"></td>
287          <td></td>
288          <td class="paramtype">int&nbsp;</td>
289          <td class="paramname"> <em>role</em></td><td>&nbsp;</td>
290        </tr>
291        <tr>
292          <td></td>
293          <td>)</td>
294          <td></td><td></td><td> const</td>
295        </tr>
296      </table>
297</div>
298<div class="memdoc">
299
300<p>Returns the data for the given <em>role</em> and <em>section</em> in the header with the specified <em>orientation</em>. </p>
301<dl><dt><b>Parameters:</b></dt><dd>
302  <table border="0" cellspacing="2" cellpadding="0">
303    <tr><td valign="top"></td><td valign="top"><em>section</em>&nbsp;</td><td>The section to get header data for. </td></tr>
304    <tr><td valign="top"></td><td valign="top"><em>orientation</em>&nbsp;</td><td>The orientation to get header data for. </td></tr>
305    <tr><td valign="top"></td><td valign="top"><em>role</em>&nbsp;</td><td>The role to get header data for. </td></tr>
306  </table>
307  </dd>
308</dl>
309<dl class="return"><dt><b>Returns:</b></dt><dd>Corresponding header data.</dd></dl>
310<p>For horizontal headers, the section number corresponds to the column number of items shown beneath it. For vertical headers, the section number typically to the row number of items shown alongside it. </p>
311
312</div>
313</div>
314<a class="anchor" id="ab2827e0bdb3246ade67df5a09805524a"></a><!-- doxytag: member="CTSPModel::loadTask" ref="ab2827e0bdb3246ade67df5a09805524a" args="(QString)" -->
315<div class="memitem">
316<div class="memproto">
317      <table class="memname">
318        <tr>
319          <td class="memname">bool CTSPModel::loadTask </td>
320          <td>(</td>
321          <td class="paramtype">QString&nbsp;</td>
322          <td class="paramname"> <em>fname</em></td>
323          <td>&nbsp;)&nbsp;</td>
324          <td></td>
325        </tr>
326      </table>
327</div>
328<div class="memdoc">
329
330<p>Loads a task from <em>fname</em>. </p>
331<dl><dt><b>Parameters:</b></dt><dd>
332  <table border="0" cellspacing="2" cellpadding="0">
333    <tr><td valign="top"></td><td valign="top"><em>fname</em>&nbsp;</td><td>The name of the file to be loaded. </td></tr>
334  </table>
335  </dd>
336</dl>
337<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> on success, otherwise <code>false</code>.</dd></dl>
338<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#aae606273bf2ad5d76779e00901d76593" title="Saves current task to fname.">saveTask()</a> </dd></dl>
339
340</div>
341</div>
342<a class="anchor" id="a4fcde91257e57ba0e9754418cb83148e"></a><!-- doxytag: member="CTSPModel::numCities" ref="a4fcde91257e57ba0e9754418cb83148e" args="() const " -->
343<div class="memitem">
344<div class="memproto">
345      <table class="memname">
346        <tr>
347          <td class="memname">quint16 CTSPModel::numCities </td>
348          <td>(</td>
349          <td class="paramname"></td>
350          <td>&nbsp;)&nbsp;</td>
351          <td> const</td>
352        </tr>
353      </table>
354</div>
355<div class="memdoc">
356
357<p>Returns the number of cities. </p>
358<dl class="return"><dt><b>Returns:</b></dt><dd>Number of cities in the current task.</dd></dl>
359<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a94b2639d6b65af914ce17b816ddc3572" title="Returns the column count in the table.">columnCount()</a>, <a class="el" href="class_c_t_s_p_model.html#a7f00cebe4cf0fed16f734544c81103f9" title="Returns the row count in the table.">rowCount()</a>, <a class="el" href="class_c_t_s_p_model.html#a5c485ac77762dbf4e27fb6d8d0664e3c" title="Sets number of cities in the current task to n.">setNumCities()</a> </dd></dl>
360
361</div>
362</div>
363<a class="anchor" id="a733908abe1ffabf49ad34ccdabaeeee9"></a><!-- doxytag: member="CTSPModel::numCitiesChanged" ref="a733908abe1ffabf49ad34ccdabaeeee9" args="(int)" -->
364<div class="memitem">
365<div class="memproto">
366      <table class="memname">
367        <tr>
368          <td class="memname">void CTSPModel::numCitiesChanged </td>
369          <td>(</td>
370          <td class="paramtype">int&nbsp;</td>
371          <td class="paramname"></td>
372          <td>&nbsp;)&nbsp;</td>
373          <td><code> [signal]</code></td>
374        </tr>
375      </table>
376</div>
377<div class="memdoc">
378
379<p>This signal is emitted whenever the number of cities in the task changes. </p>
380<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a5c485ac77762dbf4e27fb6d8d0664e3c" title="Sets number of cities in the current task to n.">setNumCities()</a> </dd></dl>
381
382</div>
383</div>
384<a class="anchor" id="ad18e48dd0b0ad56d8e4ae3b1bc039e4a"></a><!-- doxytag: member="CTSPModel::randomize" ref="ad18e48dd0b0ad56d8e4ae3b1bc039e4a" args="()" -->
385<div class="memitem">
386<div class="memproto">
387      <table class="memname">
388        <tr>
389          <td class="memname">void CTSPModel::randomize </td>
390          <td>(</td>
391          <td class="paramname"></td>
392          <td>&nbsp;)&nbsp;</td>
393          <td></td>
394        </tr>
395      </table>
396</div>
397<div class="memdoc">
398
399<p>Randomizes the table by setting all its values to random ones. </p>
400<p>Uses TSPSG settings to determine random values range.</p>
401<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a4944812fdf6d348735db401f966b4f4a" title="Resets the table, setting all its elements to 0.">clear()</a> </dd></dl>
402
403</div>
404</div>
405<a class="anchor" id="a7f00cebe4cf0fed16f734544c81103f9"></a><!-- doxytag: member="CTSPModel::rowCount" ref="a7f00cebe4cf0fed16f734544c81103f9" args="(const QModelIndex &amp;) const " -->
406<div class="memitem">
407<div class="memproto">
408      <table class="memname">
409        <tr>
410          <td class="memname">int CTSPModel::rowCount </td>
411          <td>(</td>
412          <td class="paramtype">const QModelIndex &amp;&nbsp;</td>
413          <td class="paramname"></td>
414          <td>&nbsp;)&nbsp;</td>
415          <td> const</td>
416        </tr>
417      </table>
418</div>
419<div class="memdoc">
420
421<p>Returns the row count in the table. </p>
422<dl class="return"><dt><b>Returns:</b></dt><dd>Number of rows in the table.</dd></dl>
423<p>Actually, this function returns the number of cities in the current task.</p>
424<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a94b2639d6b65af914ce17b816ddc3572" title="Returns the column count in the table.">columnCount()</a>, <a class="el" href="class_c_t_s_p_model.html#a4fcde91257e57ba0e9754418cb83148e" title="Returns the number of cities.">numCities()</a> </dd></dl>
425
426</div>
427</div>
428<a class="anchor" id="aae606273bf2ad5d76779e00901d76593"></a><!-- doxytag: member="CTSPModel::saveTask" ref="aae606273bf2ad5d76779e00901d76593" args="(QString)" -->
429<div class="memitem">
430<div class="memproto">
431      <table class="memname">
432        <tr>
433          <td class="memname">bool CTSPModel::saveTask </td>
434          <td>(</td>
435          <td class="paramtype">QString&nbsp;</td>
436          <td class="paramname"> <em>fname</em></td>
437          <td>&nbsp;)&nbsp;</td>
438          <td></td>
439        </tr>
440      </table>
441</div>
442<div class="memdoc">
443
444<p>Saves current task to <em>fname</em>. </p>
445<dl><dt><b>Parameters:</b></dt><dd>
446  <table border="0" cellspacing="2" cellpadding="0">
447    <tr><td valign="top"></td><td valign="top"><em>fname</em>&nbsp;</td><td>The name of the file to seve to. </td></tr>
448  </table>
449  </dd>
450</dl>
451<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> on success, otherwise <code>false</code>.</dd></dl>
452<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#ab2827e0bdb3246ade67df5a09805524a" title="Loads a task from fname.">loadTask()</a> </dd></dl>
453
454</div>
455</div>
456<a class="anchor" id="a4bb074d84c35fa350a55ca78b41e967f"></a><!-- doxytag: member="CTSPModel::setData" ref="a4bb074d84c35fa350a55ca78b41e967f" args="(const QModelIndex &amp;, const QVariant &amp;, int)" -->
457<div class="memitem">
458<div class="memproto">
459      <table class="memname">
460        <tr>
461          <td class="memname">bool CTSPModel::setData </td>
462          <td>(</td>
463          <td class="paramtype">const QModelIndex &amp;&nbsp;</td>
464          <td class="paramname"> <em>index</em>, </td>
465        </tr>
466        <tr>
467          <td class="paramkey"></td>
468          <td></td>
469          <td class="paramtype">const QVariant &amp;&nbsp;</td>
470          <td class="paramname"> <em>value</em>, </td>
471        </tr>
472        <tr>
473          <td class="paramkey"></td>
474          <td></td>
475          <td class="paramtype">int&nbsp;</td>
476          <td class="paramname"> <em>role</em></td><td>&nbsp;</td>
477        </tr>
478        <tr>
479          <td></td>
480          <td>)</td>
481          <td></td><td></td><td></td>
482        </tr>
483      </table>
484</div>
485<div class="memdoc">
486
487<p>Sets the <em>role</em> data for the item at <em>index</em> to <em>value</em>. </p>
488<dl><dt><b>Parameters:</b></dt><dd>
489  <table border="0" cellspacing="2" cellpadding="0">
490    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>The index of the item to set data at. </td></tr>
491    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>The value of the item data to be set. </td></tr>
492    <tr><td valign="top"></td><td valign="top"><em>role</em>&nbsp;</td><td>The role of the item to set data for. </td></tr>
493  </table>
494  </dd>
495</dl>
496<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> on success, otherwise <code>false</code>.</dd></dl>
497<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#ab8ccba12783303f239f92fe72b48793e" title="Returns the data stored under the given role for the item referred to by the index...">data()</a> </dd></dl>
498
499</div>
500</div>
501<a class="anchor" id="a5c485ac77762dbf4e27fb6d8d0664e3c"></a><!-- doxytag: member="CTSPModel::setNumCities" ref="a5c485ac77762dbf4e27fb6d8d0664e3c" args="(int)" -->
502<div class="memitem">
503<div class="memproto">
504      <table class="memname">
505        <tr>
506          <td class="memname">void CTSPModel::setNumCities </td>
507          <td>(</td>
508          <td class="paramtype">int&nbsp;</td>
509          <td class="paramname"> <em>n</em></td>
510          <td>&nbsp;)&nbsp;</td>
511          <td></td>
512        </tr>
513      </table>
514</div>
515<div class="memdoc">
516
517<p>Sets number of cities in the current task to <em>n</em>. </p>
518<dl><dt><b>Parameters:</b></dt><dd>
519  <table border="0" cellspacing="2" cellpadding="0">
520    <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>Number of cities to set to.</td></tr>
521  </table>
522  </dd>
523</dl>
524<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_c_t_s_p_model.html#a4fcde91257e57ba0e9754418cb83148e" title="Returns the number of cities.">numCities()</a> </dd></dl>
525
526</div>
527</div>
528<hr/>The documentation for this class was generated from the following files:<ul>
529<li>src/<a class="el" href="tspmodel_8h_source.html">tspmodel.h</a></li>
530<li>src/tspmodel.cpp</li>
531</ul>
532</div>
533<!--- window showing the filter options -->
534<div id="MSearchSelectWindow"
535     onmouseover="return searchBox.OnSearchSelectShow()"
536     onmouseout="return searchBox.OnSearchSelectHide()"
537     onkeydown="return searchBox.OnSearchSelectKey(event)">
538<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>
539
540<!-- iframe showing the search results (closed by default) -->
541<div id="MSearchResultsWindow">
542<iframe src="" frameborder="0" 
543        name="MSearchResults" id="MSearchResults">
544</iframe>
545</div>
546
547<hr size="1"/><address style="text-align: right;"><small>Generated on Sat Oct 24 16:33:19 2009 for TSPSG: TSP Solver and Generator by&nbsp;
548<a href="http://www.doxygen.org/index.html">
549<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
550</body>
551</html>
Note: See TracBrowser for help on using the repository browser.