From b7ebc9e902a238a9ac810f94ec6ee63e822ceb6b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 27 Oct 2014 10:51:48 -0700 Subject: [PATCH] add a class for custom HFActionEvent --- interface/src/HFActionEvent.cpp | 26 ++++++++++++++++++++++++++ interface/src/HFActionEvent.h | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 interface/src/HFActionEvent.cpp create mode 100644 interface/src/HFActionEvent.h diff --git a/interface/src/HFActionEvent.cpp b/interface/src/HFActionEvent.cpp new file mode 100644 index 0000000000..dfa08a94c5 --- /dev/null +++ b/interface/src/HFActionEvent.cpp @@ -0,0 +1,26 @@ +// +// HFActionEvent.cpp +// interface/src +// +// Created by Stephen Birarda on 2014-10-27. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "HFActionEvent.h" + +HFActionEvent::HFActionEvent() : + QEvent(HFActionEvent::type()) +{ + +} + +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 diff --git a/interface/src/HFActionEvent.h b/interface/src/HFActionEvent.h new file mode 100644 index 0000000000..68bef6ca50 --- /dev/null +++ b/interface/src/HFActionEvent.h @@ -0,0 +1,24 @@ +// +// HFActionEvent.h +// interface/src +// +// Created by Stephen Birarda on 2014-10-27. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_HFActionEvent_h +#define hifi_HFActionEvent_h + +#include + +class HFActionEvent : public QEvent { +public: + HFActionEvent(); + + static QEvent::Type type(); +}; + +#endif // hifi_HFActionEvent_h \ No newline at end of file