From 70c9aaa9c297d2b20b7d3b466ceaf5f1def36752 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 26 May 2016 17:16:43 +0200 Subject: spline-widget: allow using as preview when disabled --- spline-widget/qfunctionconfigurator.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'spline-widget/qfunctionconfigurator.h') diff --git a/spline-widget/qfunctionconfigurator.h b/spline-widget/qfunctionconfigurator.h index ffd1dd78..1700dfca 100644 --- a/spline-widget/qfunctionconfigurator.h +++ b/spline-widget/qfunctionconfigurator.h @@ -19,6 +19,7 @@ class SPLINE_WIDGET_EXPORT QFunctionConfigurator : 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) public: QFunctionConfigurator(QWidget *parent = 0); @@ -39,6 +40,8 @@ public: _background = QPixmap(); update(); } + void set_preview_only(bool val); + bool is_preview_only() const; void set_snap(int x, int y) { snap_x = x; snap_y = y; } void get_snap(int& x, int& y) const { x = snap_x; y = snap_y; } protected slots: @@ -72,8 +75,8 @@ private: QPixmap _background; QPixmap _function; - bool _draw_function; int snap_x, snap_y; + bool _draw_function, _preview_only; static constexpr int line_length_pixels = 3; static constexpr int point_size = 5; -- cgit v1.2.3