mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 21:20:06 +00:00
Add QComboBox to SettingsInterface with value mapping
This commit is contained in:
parent
70565969dc
commit
602be75222
3 changed files with 130 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue