swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame^] | 1 | #include "Cell.h" |
| 2 | |
| 3 | Cell::Cell(QObject *parent) : QObject(parent) |
| 4 | { |
| 5 | |
| 6 | } |
| 7 | |
| 8 | Cell::Cell(const Cell ©, QObject *parent) |
| 9 | : Cell(parent) |
| 10 | { |
| 11 | *this = copy; |
| 12 | } |
| 13 | |
| 14 | Cell::Cell(QString code, QString result, QObject *parent) |
| 15 | : Cell(parent) |
| 16 | { |
| 17 | setCode(code); |
| 18 | setResult(result); |
| 19 | } |
| 20 | |
| 21 | Cell &Cell::operator =(const Cell ©) |
| 22 | { |
| 23 | setCode(copy.code()); |
| 24 | setResult(copy.result()); |
| 25 | |
| 26 | return *this; |
| 27 | } |
| 28 | |
| 29 | QString Cell::code() const |
| 30 | { |
| 31 | return _code; |
| 32 | } |
| 33 | |
| 34 | QString Cell::result() const |
| 35 | { |
| 36 | return _result; |
| 37 | } |
| 38 | |
| 39 | void Cell::setCode(QString code) |
| 40 | { |
| 41 | _code = code; |
| 42 | emit codeChanged(code); |
| 43 | } |
| 44 | |
| 45 | void Cell::setResult(QString result) |
| 46 | { |
| 47 | _result = result; |
| 48 | emit resultChanged(result); |
| 49 | } |