Skip to content

Commit c49b922

Browse files
committed
Add overload setValue(const ConfigKey& key, const QFlags<EnumType>& value)
1 parent 5e7366a commit c49b922

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/preferences/configobject.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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, static_cast<int>(value));
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().

src/waveform/waveformwidgetfactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

14271427
void WaveformWidgetFactory::resetWaveformOptions() {

0 commit comments

Comments
 (0)