Add QComboBox to SettingsInterface with value mapping

This commit is contained in:
Dan Paulat 2022-12-20 23:27:06 -06:00
parent 70565969dc
commit 602be75222
3 changed files with 130 additions and 10 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include <functional>
#include <memory>
#include <string>
#include <vector>
@ -52,6 +53,24 @@ public:
*/
void SetResetButton(QAbstractButton* button);
/**
* If the edit widget displays a different value than what is stored in the
* settings variable, a mapping function must be provided in order to convert
* the value used by the edit widget from the settings value.
*
* @param function Map from settings value function
*/
void SetMapFromValueFunction(std::function<T(const T&)> function);
/**
* If the edit widget displays a different value than what is stored in the
* settings variable, a mapping function must be provided in order to convert
* the value used by the edit widget to the settings value.
*
* @param function Map to settings value function
*/
void SetMapToValueFunction(std::function<T(const T&)> function);
private:
class Impl;
std::unique_ptr<Impl> p;