diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-21 08:22:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-21 08:22:36 +0100 |
commit | ca847749c03b88d8e482396a9c4311ef02b054b9 (patch) | |
tree | c8237b2d8385f922acdb5563e417737feba3adfb /options/value.hpp | |
parent | fd0305aeecfad05f855b7d0e09a1eb9a70f4b2e5 (diff) |
options/{bundle,connector,value}: allow setting to default values
This is complicated by Qt's rejection of template classes.
Also move some stuff to slots where makes sense.
Diffstat (limited to 'options/value.hpp')
-rw-r--r-- | options/value.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/options/value.hpp b/options/value.hpp index 253da0c4..2021bd3e 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -90,6 +90,7 @@ public slots: virtual void reload() = 0; virtual void bundle_value_changed() const = 0; + virtual void set_to_default() = 0; }; namespace detail { @@ -171,6 +172,11 @@ public: return def; } + void set_to_default() override + { + *this = def; + } + operator t() const { return get(); } void reload() override |