Added getNeighbours functions to class Operation + moved UpdateMeshDensity to class...
[engrid.git] / settingssheet.h
blobb29ca041d99e3bb7c9037a3a2b07f595ec5bdfba
1 //
2 // C++ Interface: settingssheet
3 //
4 // Description:
5 //
6 //
7 // Author: Mike Taverne <mtaverne@engits.com>, (C) 2009
8 //
9 // Copyright: See COPYING file that comes with this distribution
12 #ifndef SETTINGSSHEET_H
13 #define SETTINGSSHEET_H
15 #include <QTableWidget>
16 #include <QTableWidgetItem>
18 class Cell : public QTableWidgetItem
20 public:
21 Cell();
23 QTableWidgetItem *clone() const;
24 void setData(int role, const QVariant &value);
25 QVariant data(int role) const;
26 void setFormula(const QString &formula);
27 QString formula() const;
28 void setDirty();
30 private:
31 QVariant value() const;
32 QVariant evalExpression(const QString &str, int &pos) const;
33 QVariant evalTerm(const QString &str, int &pos) const;
34 QVariant evalFactor(const QString &str, int &pos) const;
36 mutable QVariant cachedValue;
37 mutable bool cacheIsDirty;
40 class SettingsSheet : public QTableWidget
42 Q_OBJECT
43 public:
44 SettingsSheet(QWidget *parent = 0);
46 ~SettingsSheet();
48 bool readFile(const QString &fileName,int verbose=1);
49 bool writeFile(const QString &fileName);
50 void setFormula(int row, int column, const QString &formula);
51 QString formula(int row, int column) const;
52 Cell* cell(int row, int column) const;
54 private:
55 enum { MagicNumber = 0x7F51C883 };
59 #endif