X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..7b1c7e44123b9b2626205a89e27b2a4712ea30c6:/BlockParameter.cpp 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;