X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/8d3e09e430e829b9d847847334cbfe37790baca3..5d4e709cb8d460b2efc083e6e7999f1c3a0eb602:/BlockParameter.cpp?ds=sidebyside diff --git a/BlockParameter.cpp b/BlockParameter.cpp index f8dfcd7..6207148 100644 --- a/BlockParameter.cpp +++ b/BlockParameter.cpp @@ -22,6 +22,37 @@ QVariant BlockParameter::getValue() { return defaultValue; } +bool BlockParameter::getBooleanValue(bool* ok) { + if (type == Boolean) { + *ok = true; + return getValue().toBool(); + } + *ok = false; + return false; +} + +int BlockParameter::getIntValue(bool* ok) { + if ((type == Natural) || (type == Positive) || (type == Integer)) { + *ok = true; + return getValue().toInt(); + } + *ok = false; + return 0; +} + +double BlockParameter::getDoubleValue(bool* ok) { + if ((type == Real) || (type == Natural) || (type == Positive) || (type == Integer)) { + *ok = true; + return getValue().toDouble(); + } + *ok = false; + return 0.0; +} + +QString BlockParameter::getStringValue() { + return getValue().toString(); +} + bool BlockParameter::isUserParameter() { return false;