Changeset 21 in tspsg-svn for trunk/src/tspmodel.cpp


Ignore:
Timestamp:
Jun 22, 2009, 1:37:12 AM (16 years ago)
Author:
laleppa
Message:

+ Settings are now saved and restored.
+ Font color selection in settings.
+ Primitive about dialog.
+ Automatic resizing of cells to its contents in wince.

  • No "Save window position" checkbox in wince.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        11*.idb
         2*.ini
        23*.ncb
        34*.pdb
  • trunk/src/tspmodel.cpp

    r19 r21  
    2323
    2424#include <QtGui>
     25#include "defines.h"
    2526#include "tspmodel.h"
    2627
    2728CTSPModel::CTSPModel(QObject *parent)
    28         : QAbstractTableModel(parent), randMin(1), randMax(10), nCities(0)
     29        : QAbstractTableModel(parent), nCities(0)
    2930{
     31        settings = new QSettings(INI_FILE,QSettings::IniFormat);
    3032}
    3133
     
    115117void CTSPModel::setNumCities(int n)
    116118{
     119int randMin = settings->value("MinCost",DEF_RAND_MIN).toInt();
     120int randMax = settings->value("MaxCost",DEF_RAND_MAX).toInt();
    117121        if (n == nCities)
    118122                return;
     
    140144void CTSPModel::randomize()
    141145{
     146int randMin = settings->value("MinCost",DEF_RAND_MIN).toInt();
     147int randMax = settings->value("MaxCost",DEF_RAND_MAX).toInt();
    142148        for (int r = 0; r < nCities; r++)
    143149                for (int c = 0; c < nCities; c++)
Note: See TracChangeset for help on using the changeset viewer.