X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..8f0bedf735fe2b306c11c3f4a168245a05e37ccd:/BlockParameter.cpp diff --git a/BlockParameter.cpp b/BlockParameter.cpp index f8dfcd7..b4fce09 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;