Changeset 149 in tspsg-svn for trunk/src/tspmodel.h
- Timestamp:
- Dec 20, 2010, 9:53:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tspmodel.h
r116 r149 37 37 class CTSPModel: public QAbstractTableModel 38 38 { 39 39 Q_OBJECT 40 40 41 41 public: 42 43 44 45 46 47 48 49 50 51 52 53 54 42 CTSPModel(QObject *parent = 0); 43 void clear(); 44 int columnCount(const QModelIndex &parent = QModelIndex()) const; 45 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 46 Qt::ItemFlags flags(const QModelIndex &index) const; 47 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 48 bool loadTask(const QString &fname); 49 quint16 numCities() const; 50 void randomize(); 51 int rowCount(const QModelIndex &parent = QModelIndex()) const; 52 bool saveTask(const QString &fname); 53 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); 54 void setNumCities(int n); 55 55 56 56 signals: 57 58 59 60 61 62 57 /*! 58 * \brief This signal is emitted whenever the number of cities in the task changes. 59 * 60 * \sa setNumCities() 61 */ 62 void numCitiesChanged(int); 63 63 64 64 private: 65 66 67 68 69 70 71 65 QSettings *settings; 66 QVector<QVector<double> > table; 67 quint16 nCities; 68 bool loadError(QDataStream::Status); 69 bool loadTSPT(QDataStream *); 70 bool loadZKT(QDataStream *); 71 double rand(int, int) const; 72 72 }; 73 73
Note: See TracChangeset
for help on using the changeset viewer.