diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-17 13:46:46 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-17 13:46:46 +0100 |
commit | da4ee3868d7a014be42e998a7b7c98a149586d85 (patch) | |
tree | 7ca23a0ef9e532d9551449e697c9ae5c059334ec /options | |
parent | ba25e41d49fd5e9f46840d0b876df21ad5f583db (diff) |
options, tracker/pt: allow force-reloading value_::valueChanged
Fixes auto threshold slider label text on toggling the checkbox without
dragging the slider.
Diffstat (limited to 'options')
-rw-r--r-- | options/base-value.hpp | 1 | ||||
-rw-r--r-- | options/value.hpp | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/options/base-value.hpp b/options/base-value.hpp index 6365f82a..d0fa42cf 100644 --- a/options/base-value.hpp +++ b/options/base-value.hpp @@ -95,6 +95,7 @@ public slots: virtual void set_to_default() noexcept = 0; virtual void notify() const = 0; + virtual void notify_() const = 0; virtual QVariant get_variant() const noexcept = 0; }; diff --git a/options/value.hpp b/options/value.hpp index 85b76cb6..090a7bdf 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -95,6 +95,19 @@ public: } never_inline + void notify_() const override + { + auto x = get(); + { + QMutexLocker l(&mtx); + cached_value = x; + } + maybe_trace("notify +"); + emit valueChanged(traits::storage_from_value(x)); + maybe_trace("notify -"); + } + + never_inline void notify() const override { if (is_null()) |