Skip to content

Commit ed08202

Browse files
committed
Fix compiler error
1 parent f2210ec commit ed08202

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/config/DspConfig.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,26 @@ class DspConfig :
139139
auto variant = _conf->getVariant(skey, true, exists);
140140

141141
if constexpr (std::is_same_v<T, QVariant>) {
142-
return variant;
142+
return (T)(variant);
143143
}
144144
if constexpr (std::is_same_v<T, std::string>) {
145-
return variant.toString().toStdString();
145+
return (T)(variant.toString().toStdString());
146146
}
147147
if constexpr (std::is_same_v<T, QString>) {
148-
return variant.toString();
148+
return (T)(variant.toString());
149149
}
150150
if constexpr (std::is_same_v<T, int>) {
151-
return variant.toInt();
151+
return (T)(variant.toInt());
152152
}
153153
if constexpr (std::is_same_v<T, float>) {
154-
return variant.toFloat();
154+
return (T)(variant.toFloat());
155155
}
156156
if constexpr (std::is_same_v<T, bool>) {
157-
return variant.toBool();
157+
return (T)(variant.toBool());
158158
}
159159

160160
Log::error("DspConfig::get<T>: Unknown type T");
161-
return 0;
161+
throw new std::exception;
162162
}
163163

164164
Type type(const Key &key)

0 commit comments

Comments
 (0)