From 55735a3f0dab52c233c4c5a9eb9d9ac08e96613a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 27 Oct 2014 11:11:23 -0700 Subject: [PATCH] add start and end to HFActionEvent --- interface/src/HFActionEvent.cpp | 21 ++++++++++++--------- interface/src/HFActionEvent.h | 5 +++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/interface/src/HFActionEvent.cpp b/interface/src/HFActionEvent.cpp index 6f98e2963f..2ab2001ba4 100644 --- a/interface/src/HFActionEvent.cpp +++ b/interface/src/HFActionEvent.cpp @@ -11,17 +11,20 @@ #include "HFActionEvent.h" -HFActionEvent::HFActionEvent(const QPointF& localPosition) : - QEvent(HFActionEvent::type()), +HFActionEvent::HFActionEvent(QEvent::Type type, const QPointF& localPosition) : + QEvent(type), _localPosition(localPosition) { } -QEvent::Type HFActionEvent::type() { - static QEvent::Type hfActionType = QEvent::None; - if (hfActionType == QEvent::None) { - hfActionType = static_cast(QEvent::registerEventType()); - } - return hfActionType; -} \ No newline at end of file +QEvent::Type HFActionEvent::startType() { + static QEvent::Type startType = static_cast(QEvent::registerEventType()); + return startType; +} + +QEvent::Type HFActionEvent::endType() { + static QEvent::Type endType = static_cast(QEvent::registerEventType()); + return endType; +} + diff --git a/interface/src/HFActionEvent.h b/interface/src/HFActionEvent.h index 19b6dc8469..2c7d323dc9 100644 --- a/interface/src/HFActionEvent.h +++ b/interface/src/HFActionEvent.h @@ -16,9 +16,10 @@ class HFActionEvent : public QEvent { public: - HFActionEvent(const QPointF& localPosition); + HFActionEvent(QEvent::Type type, const QPointF& localPosition); - static QEvent::Type type(); + static QEvent::Type startType(); + static QEvent::Type endType(); private: QPointF _localPosition; };