Torc  0.1
torcevent.cpp
Go to the documentation of this file.
1 /* Class TorcEvent
2 *
3 * This file is part of the Torc project.
4 *
5 * Copyright (C) Mark Kendall 2012-18
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20 * USA.
21 */
22 
23 // Torc
24 #include "torcevent.h"
25 
53 QEvent::Type TorcEvent::TorcEventType = (QEvent::Type) QEvent::registerEventType();
55 
57 TorcEvent::TorcEvent(int Event, const QVariantMap &Data/* = QVariantMap()*/)
58  : QEvent(TorcEventType),
59  m_event(Event),
60  m_data(Data)
61 {
62 }
63 
66 {
67  return m_event;
68 }
69 
71 QVariantMap& TorcEvent::Data(void)
72 {
73  return m_data;
74 }
75 
83 {
84  return new TorcEvent(m_event, m_data);
85 }
TorcEvent * Copy(void) const
Copy this event.
Definition: torcevent.cpp:82
int GetEvent(void)
Return the Torc action associated with this event.
Definition: torcevent.cpp:65
QVariantMap & Data(void)
Return a reference to the Data contained within this event.
Definition: torcevent.cpp:71
static Type TorcEventType
Register TorcEventType with QEvent.
Definition: torcevent.h:19
TorcEvent(int Event, const QVariantMap &Data=QVariantMap())
The default implementation contains no data.
Definition: torcevent.cpp:57
A general purpose event object.
Definition: torcevent.h:9