Changeset 72 in tspsg-svn for trunk/docs/html/tspmodel_8h_source.html
- Timestamp:
- Dec 7, 2009, 5:50:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/html/tspmodel_8h_source.html
r68 r72 90 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 91 <a name="l00032"></a>00032 92 <a name="l00037"></a><a class="code" href="class_c_t_s_p_model.html">00037</a> <span class="keyword">class </span><a class="code" href="class_c_t_s_p_model.html" title="This class implements table model for manipulating a task.">CTSPModel</a>: <span class="keyword">public</span> QAbstractTableModel92 <a name="l00037"></a><a class="code" href="class_c_t_s_p_model.html">00037</a> <span class="keyword">class </span><a class="code" href="class_c_t_s_p_model.html" title="This class implements table model for manipulating a task.">CTSPModel</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/qabstracttablemodel.html">QAbstractTableModel</a> 93 93 <a name="l00038"></a>00038 { 94 94 <a name="l00039"></a>00039 Q_OBJECT 95 95 <a name="l00040"></a>00040 96 96 <a name="l00041"></a>00041 <span class="keyword">public</span>: 97 <a name="l00042"></a>00042 <a class="code" href="class_c_t_s_p_model.html#a50a24986bc34b37c6c3b7bb52371b837" title="Class constructor.">CTSPModel</a>( QObject*parent = 0);97 <a name="l00042"></a>00042 <a class="code" href="class_c_t_s_p_model.html#a50a24986bc34b37c6c3b7bb52371b837" title="Class constructor.">CTSPModel</a>(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html">QObject</a> *parent = 0); 98 98 <a name="l00043"></a>00043 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#a4944812fdf6d348735db401f966b4f4a" title="Resets the table, setting all its elements to 0.">clear</a>(); 99 <a name="l00044"></a>00044 <span class="keywordtype">int</span> <a class="code" href="class_c_t_s_p_model.html#a 94b2639d6b65af914ce17b816ddc3572" title="Returns the column count in the table.">columnCount</a>(<span class="keyword">const</span> QModelIndex &) <span class="keyword">const</span>;100 <a name="l00045"></a>00045 QVariant <a class="code" 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>(<span class="keyword">const</span> QModelIndex &, <span class="keywordtype">int</span>) <span class="keyword">const</span>;101 <a name="l00046"></a>00046 Qt::ItemFlags <a class="code" href="class_c_t_s_p_model.html#a 057b15ee4fc0f8c7b5648188b8173db6" title="Returns the item flags for the given index.">flags</a>(<span class="keyword">const</span> QModelIndex &) <span class="keyword">const</span>;102 <a name="l00047"></a>00047 QVariant <a class="code" 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>(<span class="keywordtype">int</span>, Qt::Orientation, <span class="keywordtype">int</span>) <span class="keyword">const</span>;103 <a name="l00048"></a>00048 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#a b2827e0bdb3246ade67df5a09805524a" title="Loads a task from fname.">loadTask</a>(QString);99 <a name="l00044"></a>00044 <span class="keywordtype">int</span> <a class="code" href="class_c_t_s_p_model.html#ac1942bbffc1313543641881e456f2e55" title="Returns the column count in the table.">columnCount</a>(<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> &parent = <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>()) <span class="keyword">const</span>; 100 <a name="l00045"></a>00045 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvariant.html">QVariant</a> <a class="code" href="class_c_t_s_p_model.html#aad200081a43582e766096807c04227dc" title="Returns the data stored under the given role for the item referred to by the index...">data</a>(<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> &<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qabstracttablemodel.html#index">index</a>, <span class="keywordtype">int</span> role = Qt::DisplayRole) <span class="keyword">const</span>; 101 <a name="l00046"></a>00046 Qt::ItemFlags <a class="code" href="class_c_t_s_p_model.html#a77881106624bfc203fb97bffe0d7b585" title="Returns the item flags for the given index.">flags</a>(<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> &index) <span class="keyword">const</span>; 102 <a name="l00047"></a>00047 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvariant.html">QVariant</a> <a class="code" href="class_c_t_s_p_model.html#a8c716850f6c31fa42b219d7f84038d71" title="Returns the data for the given role and section in the header with the specified...">headerData</a>(<span class="keywordtype">int</span> section, Qt::Orientation orientation, <span class="keywordtype">int</span> role = Qt::DisplayRole) <span class="keyword">const</span>; 103 <a name="l00048"></a>00048 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#ae25b1d25b13488fde89e381152c62549" title="Loads a task from fname.">loadTask</a>(<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> &fname); 104 104 <a name="l00049"></a>00049 quint16 <a class="code" href="class_c_t_s_p_model.html#a4fcde91257e57ba0e9754418cb83148e" title="Returns the number of cities.">numCities</a>() <span class="keyword">const</span>; 105 105 <a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#ad18e48dd0b0ad56d8e4ae3b1bc039e4a" title="Randomizes the table by setting all its values to random ones.">randomize</a>(); 106 <a name="l00051"></a>00051 <span class="keywordtype">int</span> <a class="code" href="class_c_t_s_p_model.html#a 7f00cebe4cf0fed16f734544c81103f9" title="Returns the row count in the table.">rowCount</a>(<span class="keyword">const</span> QModelIndex &) <span class="keyword">const</span>;107 <a name="l00052"></a>00052 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#aa e606273bf2ad5d76779e00901d76593" title="Saves current task to fname.">saveTask</a>(QString);108 <a name="l00053"></a>00053 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#a 4bb074d84c35fa350a55ca78b41e967f" title="Sets the role data for the item at index to value.">setData</a>(<span class="keyword">const</span> QModelIndex &, <span class="keyword">const</span> QVariant &, <span class="keywordtype">int</span>);109 <a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#a 5c485ac77762dbf4e27fb6d8d0664e3c" title="Sets number of cities in the current task to n.">setNumCities</a>(<span class="keywordtype">int</span>);106 <a name="l00051"></a>00051 <span class="keywordtype">int</span> <a class="code" href="class_c_t_s_p_model.html#a419c2b9d40fc2f348b15ae02f442a39b" title="Returns the row count in the table.">rowCount</a>(<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> &parent = <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>()) <span class="keyword">const</span>; 107 <a name="l00052"></a>00052 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#aa73d906286cf369d9e6352348e1aca61" title="Saves current task to fname.">saveTask</a>(<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> &fname); 108 <a name="l00053"></a>00053 <span class="keywordtype">bool</span> <a class="code" href="class_c_t_s_p_model.html#a614a0e748bdf52c504a0284c07a977ed" title="Sets the role data for the item at index to value.">setData</a>(<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> &index, <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/qvariant.html">QVariant</a> &value, <span class="keywordtype">int</span> role = Qt::EditRole); 109 <a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="class_c_t_s_p_model.html#aff717cb92ce6426033e85716644b9cef" title="Sets number of cities in the current task to n.">setNumCities</a>(<span class="keywordtype">int</span> n); 110 110 <a name="l00055"></a>00055 111 111 <a name="l00056"></a>00056 signals: … … 113 113 <a name="l00063"></a>00063 114 114 <a name="l00064"></a>00064 <span class="keyword">private</span>: 115 <a name="l00065"></a>00065 QSettings*settings;116 <a name="l00066"></a>00066 QVector<QVector<double>> table;115 <a name="l00065"></a>00065 <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; 116 <a name="l00066"></a>00066 <a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qvector.html">QVector<QVector<double></a> > table; 117 117 <a name="l00067"></a>00067 quint16 nCities; 118 118 <a name="l00068"></a>00068 <span class="keywordtype">bool</span> loadError(QDataStream::Status); 119 <a name="l00069"></a>00069 <span class="keywordtype">bool</span> loadTSPT( QDataStream*);120 <a name="l00070"></a>00070 <span class="keywordtype">bool</span> loadZKT( QDataStream*);119 <a name="l00069"></a>00069 <span class="keywordtype">bool</span> loadTSPT(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdatastream.html">QDataStream</a> *); 120 <a name="l00070"></a>00070 <span class="keywordtype">bool</span> loadZKT(<a class="codeRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qdatastream.html">QDataStream</a> *); 121 121 <a name="l00071"></a>00071 <span class="keywordtype">int</span> rand(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>) <span class="keyword">const</span>; 122 122 <a name="l00072"></a>00072 }; … … 138 138 </div> 139 139 140 <hr size="1"/><address style="text-align: right;"><small>Generated on Sat Oct 24 16:33:192009 for TSPSG: TSP Solver and Generator by 140 <hr size="1"/><address style="text-align: right;"><small>Generated on Mon Dec 7 18:11:34 2009 for TSPSG: TSP Solver and Generator by 141 141 <a href="http://www.doxygen.org/index.html"> 142 142 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
Note: See TracChangeset
for help on using the changeset viewer.