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