mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:20:04 +00:00
Adding common edit widget and reset button processing to settings variable
This commit is contained in:
parent
463acd6b94
commit
ce5092c068
3 changed files with 169 additions and 10 deletions
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
#include <functional>
|
||||
|
||||
class QAbstractButton;
|
||||
class QWidget;
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
|
|
@ -72,6 +75,11 @@ public:
|
|||
*/
|
||||
void Commit();
|
||||
|
||||
/**
|
||||
* Clears the staged value of the settings variable.
|
||||
*/
|
||||
void Reset();
|
||||
|
||||
/**
|
||||
* Validate the value against the defined parameters of the settings
|
||||
* variable.
|
||||
|
|
@ -135,6 +143,20 @@ public:
|
|||
*/
|
||||
virtual void WriteValue(boost::json::object& json) const override;
|
||||
|
||||
/**
|
||||
* Sets the edit widget from the settings dialog.
|
||||
*
|
||||
* @param widget Edit widget
|
||||
*/
|
||||
void SetEditWidget(QWidget* widget);
|
||||
|
||||
/**
|
||||
* Sets the reset button from the settings dialog.
|
||||
*
|
||||
* @param button Reset button
|
||||
*/
|
||||
void SetResetButton(QAbstractButton* button);
|
||||
|
||||
protected:
|
||||
virtual bool Equals(const SettingsVariableBase& o) const override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue