From bb6b87a2685c0d71b5c38be33c100f85ac0b9cee Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 25 Jul 2019 09:59:29 +0200 Subject: Rework of the component to be a proper lib --- result/stringresult.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'result/stringresult.cpp') 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(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(); -- cgit v1.2.3-70-g09d2