summaryrefslogtreecommitdiffhomepage
path: root/options/slider.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-13 18:53:28 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-13 18:53:28 +0200
commit9da6dff1800d6b6598e6ad04465ee8b9cabb4167 (patch)
tree2f1692597748ce37d2ce147e8ed9f0c7d71d00e9 /options/slider.hpp
parent535e81402a65fa410e98899cd1780784d2f9815a (diff)
tracker/pt, options: fix threshold slider
It's only the tie_setting(slider_value, QSlider) that has race-free slider updates. Needed to update the threshold slider representation. Remove the tie_setting(int, QSlider) overload since it doesn't have the logic. Add a migration. Add base_value::notify() for use-cases like the checkbox updating the label.
Diffstat (limited to 'options/slider.hpp')
-rw-r--r--options/slider.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/options/slider.hpp b/options/slider.hpp
index bda1d398..da6bf214 100644
--- a/options/slider.hpp
+++ b/options/slider.hpp
@@ -8,6 +8,9 @@
#pragma once
#include "export.hpp"
+
+#include "compat/util.hpp"
+
#include <QMetaType>
#include <QDataStream>
#include <QDebug>
@@ -31,6 +34,7 @@ namespace options
slider_value& operator=(const slider_value& v);
bool operator==(const slider_value& v) const;
operator double() const { return cur_; }
+ explicit operator int() const { return iround(cur_); }
double cur() const { return cur_; }
double min() const { return min_; }
double max() const { return max_; }