Skip to content

Commit be7c132

Browse files
committed
getParamInd and getParamDouble now both work for int and double parameters
1 parent e4bb5ff commit be7c132

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

configparams.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ double ConfigParams::getParamDouble(const QString &name)
195195

196196
if (p.type == CFG_T_DOUBLE) {
197197
retVal = p.valDouble;
198+
} else if (p.type == CFG_T_INT) {
199+
retVal = double(p.valInt);
198200
} else {
199201
qWarning() << name << "wrong type";
200202
}
@@ -214,6 +216,8 @@ int ConfigParams::getParamInt(const QString &name)
214216

215217
if (p.type == CFG_T_INT || p.type == CFG_T_BITFIELD) {
216218
retVal = p.valInt;
219+
} else if (p.type == CFG_T_DOUBLE) {
220+
retVal = int(p.valDouble);
217221
} else {
218222
qWarning() << name << "wrong type";
219223
}

0 commit comments

Comments
 (0)