diff options
| author | 2019-07-25 09:59:29 +0200 | |
|---|---|---|
| committer | 2019-07-25 09:59:29 +0200 | |
| commit | bb6b87a2685c0d71b5c38be33c100f85ac0b9cee (patch) | |
| tree | 81da599ceec1368e55fee5fd6a4dd0173fc39b5f /result/stringresult.cpp | |
| parent | 6f499de159eeac37fe473f945042e13359dc2d40 (diff) | |
| download | OneRoll-bb6b87a2685c0d71b5c38be33c100f85ac0b9cee.tar.gz OneRoll-bb6b87a2685c0d71b5c38be33c100f85ac0b9cee.zip | |
Rework of the component to be a proper lib
Diffstat (limited to 'result/stringresult.cpp')
| -rw-r--r-- | result/stringresult.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/result/stringresult.cpp b/result/stringresult.cpp index a44e24e..d5a7880 100644 --- a/result/stringresult.cpp +++ b/result/stringresult.cpp @@ -3,20 +3,21 @@ StringResult::StringResult() { m_highlight= true; - m_resultTypes= Result::STRING; + m_resultTypes= static_cast<int>(Dice::RESULT_TYPE::STRING); } void StringResult::setText(QString text) { m_value= text; } StringResult::~StringResult() {} -bool StringResult::hasResultOfType(RESULT_TYPE resultType) const +bool StringResult::hasResultOfType(Dice::RESULT_TYPE resultType) const { - if(resultType & Result::STRING) + + if(resultType == Dice::RESULT_TYPE::STRING) { return true; } - else if(resultType & Result::SCALAR) + else if(resultType == Dice::RESULT_TYPE::SCALAR) { bool ok= false; getText().toInt(&ok); @@ -28,13 +29,13 @@ QString StringResult::getText() const { return m_value; } -QVariant StringResult::getResult(RESULT_TYPE type) +QVariant StringResult::getResult(Dice::RESULT_TYPE type) { switch(type) { - case STRING: + case Dice::RESULT_TYPE::STRING: return getText(); - case SCALAR: + case Dice::RESULT_TYPE::SCALAR: return getText().toInt(); default: return QVariant(); |