summaryrefslogtreecommitdiffhomepage
path: root/spline-widget/spline-widget.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-05 18:24:01 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-05 18:24:01 +0200
commit9e63b4ecafcb66c275760cd28d2cfb0d258a474e (patch)
treebde33bb3e4d3c576637709f056ca994372d9a588 /spline-widget/spline-widget.hpp
parentb77a3539a46f9ac8fc06ee701e00512aac4c7550 (diff)
spline-widget: stop dragging when alt-tabbing away
Unfortunately now spline widgets grab keyboard focus. Qt doesn't seem to have a better way to detect whether some other application gained focus.
Diffstat (limited to 'spline-widget/spline-widget.hpp')
-rw-r--r--spline-widget/spline-widget.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/spline-widget/spline-widget.hpp b/spline-widget/spline-widget.hpp
index 53560d6a..477e3ba6 100644
--- a/spline-widget/spline-widget.hpp
+++ b/spline-widget/spline-widget.hpp
@@ -22,6 +22,7 @@ using namespace options;
#include <QPointF>
#include <QToolTip>
#include <QShowEvent>
+#include <QFocusEvent>
#include <QMetaObject>
#include <QDebug>
@@ -74,7 +75,8 @@ private:
void drawPoint(QPainter& painter, const QPointF& pt, const QColor& colBG, const QColor& border = QColor(50, 100, 120, 200));
void drawLine(QPainter& painter, const QPoint& start, const QPoint& end, const QPen& pen);
bool point_within_pixel(const QPointF& pt, const QPoint& pixel);
-protected:
+
+ void focusOutEvent(QFocusEvent*e) override;
void resizeEvent(QResizeEvent *) override;
private:
bool is_on_pt(const QPoint& pos, int* pt = nullptr);