Skip to content

Commit 231b589

Browse files
committed
Add overload setValue(const ConfigKey& key, const QFlags<EnumType>& value)
1 parent ebc6f4c commit 231b589

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
@@ -1422,7 +1422,7 @@ void WaveformWidgetFactory::setWaveformOption(
14221422
currentOptions.setFlag(option, enabled);
14231423
// clear unsupported options
14241424
currentOptions &= supportedOptions;
1425-
m_config->setValue<int>(kWaveformOptionsKey, currentOptions);
1425+
m_config->setValue(kWaveformOptionsKey, currentOptions);
14261426
}
14271427

14281428
void WaveformWidgetFactory::resetWaveformOptions() {

0 commit comments

Comments
 (0)