Adding common edit widget and reset button processing to settings variable

This commit is contained in:
Dan Paulat 2022-12-20 00:38:16 -06:00
parent 463acd6b94
commit ce5092c068
3 changed files with 169 additions and 10 deletions

View file

@ -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;