summaryrefslogtreecommitdiffhomepage
path: root/spline-widget/spline-widget.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-08 05:38:00 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-08 05:38:00 +0100
commitb48a48c143d64caac7d456f9f2a7db180f845a9a (patch)
tree1c44500607674f8b5234a97ee1341c582b14633d /spline-widget/spline-widget.hpp
parentec4c9bb2b53d351dd20f3db342a79a9a75fbc5b9 (diff)
spline-widget: improve preview mode for tobii
Diffstat (limited to 'spline-widget/spline-widget.hpp')
-rw-r--r--spline-widget/spline-widget.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/spline-widget/spline-widget.hpp b/spline-widget/spline-widget.hpp
index d52e249c..921f44a2 100644
--- a/spline-widget/spline-widget.hpp
+++ b/spline-widget/spline-widget.hpp
@@ -32,6 +32,8 @@ class OPENTRACK_SPLINE_EXPORT spline_widget final : public QWidget
Q_OBJECT
Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier)
Q_PROPERTY(bool is_preview_only READ is_preview_only WRITE set_preview_only)
+ Q_PROPERTY(int x_step READ x_step WRITE set_x_step)
+ Q_PROPERTY(int y_step READ y_step WRITE set_y_step)
using points_t = spline::points_t;
public:
@@ -47,6 +49,12 @@ public:
void force_redraw();
void set_preview_only(bool val);
bool is_preview_only() const;
+
+ double x_step() { return _x_step; }
+ double y_step() { return _y_step; }
+ void set_x_step(double val) { _x_step = val; }
+ void set_y_step(double val) { _y_step = val; }
+
void set_snap(double x, double y) { snap_x = x; snap_y = y; }
void get_snap(double& x, double& y) const { x = snap_x; y = snap_y; }
protected slots:
@@ -57,7 +65,7 @@ protected slots:
void reload_spline();
private:
int get_closeness_limit();
- void show_tooltip(const QPoint& pos, const QPointF& value = QPointF(0, 0), const QString& prefix = QStringLiteral(""));
+ void show_tooltip(const QPoint& pos, const QPointF& value = QPointF(0, 0));
bool is_in_bounds(const QPoint& pos) const;
void drawBackground();
@@ -89,6 +97,7 @@ private:
QMetaObject::Connection connection;
double snap_x, snap_y;
+ double _x_step, _y_step;
int moving_control_point_idx;
bool _draw_function, _preview_only;