mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 23:40:04 +00:00
added full unit support for radius field, implemented such that future fields needing units can be done easily
This commit is contained in:
parent
c53836e91a
commit
146055fb99
7 changed files with 103 additions and 24 deletions
|
|
@ -7,6 +7,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class QLabel;
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
|
|
@ -91,6 +93,13 @@ public:
|
|||
*/
|
||||
void SetResetButton(QAbstractButton* button) override;
|
||||
|
||||
/**
|
||||
* Sets the label for units from the settings dialog.
|
||||
*
|
||||
* @param label Unit label
|
||||
*/
|
||||
void SetUnitLabel(QLabel* label);
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
@ -109,6 +118,14 @@ public:
|
|||
*/
|
||||
void SetMapToValueFunction(std::function<T(const std::string&)> function);
|
||||
|
||||
/**
|
||||
* Sets the unit to be used by this setting.
|
||||
*
|
||||
* @param scale The radio of the current unit to the base unit
|
||||
* @param abbreviation The abreviation to be displayed
|
||||
*/
|
||||
void SetUnit(const double& scale, const std::string& abbreviation);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue