add start and end to HFActionEvent

This commit is contained in:
Stephen Birarda 2014-10-27 11:11:23 -07:00
parent d09c9233d8
commit 55735a3f0d
2 changed files with 15 additions and 11 deletions

View file

@ -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::Type>(QEvent::registerEventType());
}
return hfActionType;
}
QEvent::Type HFActionEvent::startType() {
static QEvent::Type startType = static_cast<QEvent::Type>(QEvent::registerEventType());
return startType;
}
QEvent::Type HFActionEvent::endType() {
static QEvent::Type endType = static_cast<QEvent::Type>(QEvent::registerEventType());
return endType;
}

View file

@ -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;
};