| 50 | } |
| 51 | |
| 52 | Variable::Variable(TreeModel* model, TreeItem* parent, |
| 53 | const QString& expression, |
| 54 | const QString& display) |
| 55 | : TreeItem(model, parent) |
| 56 | , m_expression(expression) |
| 57 | , m_inScope(true) |
| 58 | , m_topLevel(true) |
| 59 | , m_changed(false) |
| 60 | , m_showError(false) |
| 61 | , m_format(Natural) |
| 62 | { |
| 63 | // FIXME: should not duplicate the data, instead overload 'data' |
| 64 | // and return expression_ directly. |
| 65 | if (display.isEmpty()) |
| 66 | setData(QVector<QVariant>{expression, QString(), QString()}); |
| 67 | else |
| 68 | setData(QVector<QVariant>{display, QString(), QString()}); |
| 69 | } |
| 70 | |
| 71 | QString Variable::expression() const |
| 72 | { |