File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,6 +164,11 @@ template <class ValueType> class ConfigObject {
164164 void setValue (const ConfigKey& key, const EnumType& value) {
165165 setValue<int >(key, static_cast <int >(value));
166166 };
167+ template <class EnumType >
168+ requires std::is_enum_v<EnumType>
169+ void setValue (const ConfigKey& key, const QFlags<EnumType>& value) {
170+ setValue<int >(key, value.toInt ());
171+ }
167172
168173 // Returns the value for key, converted to ResultType. If key is not present
169174 // or the value cannot be converted to ResultType, returns ResultType().
@@ -187,6 +192,12 @@ template <class ValueType> class ConfigObject {
187192 // we need to take default_value as const ref otherwise the overload is ambiguous
188193 return static_cast <EnumType>(getValue<int >(key, static_cast <int >(default_value)));
189194 }
195+ template <typename EnumType>
196+ requires std::is_enum_v<EnumType>
197+ QFlags<EnumType> getValue (const ConfigKey& key, const QFlags<EnumType>& default_value) const {
198+ // we need to take default_value as const ref otherwise the overload is ambiguous
199+ return QFlags<EnumType>::fromInt (getValue<int >(key, default_value.toInt ()));
200+ }
190201
191202 QMultiHash<ValueType, ConfigKey> transpose () const ;
192203
Original file line number Diff line number Diff line change @@ -1421,7 +1421,7 @@ void WaveformWidgetFactory::setWaveformOption(
14211421 currentOptions.setFlag (option, enabled);
14221422 // clear unsupported options
14231423 currentOptions &= supportedOptions;
1424- m_config->setValue < int > (kWaveformOptionsKey , currentOptions);
1424+ m_config->setValue (kWaveformOptionsKey , currentOptions);
14251425}
14261426
14271427void WaveformWidgetFactory::resetWaveformOptions () {
You can’t perform that action at this time.
0 commit comments