summaryrefslogtreecommitdiffstats
path: root/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp')
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
index b136ce8..22ea0fe 100644
--- a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
@@ -41,7 +41,9 @@
#include "qmeegoswitchevent.h"
-QMeeGoSwitchEvent::QMeeGoSwitchEvent(const QString &graphicsSystemName, QMeeGoSwitchEvent::State s) : QEvent((QEvent::Type) QMeeGoSwitchEvent::SwitchEvent)
+static int switchEventNumber = -1;
+
+QMeeGoSwitchEvent::QMeeGoSwitchEvent(const QString &graphicsSystemName, QMeeGoSwitchEvent::State s) : QEvent(QMeeGoSwitchEvent::eventNumber())
{
name = graphicsSystemName;
switchState = s;
@@ -55,4 +57,12 @@ QString QMeeGoSwitchEvent::graphicsSystemName() const
QMeeGoSwitchEvent::State QMeeGoSwitchEvent::state() const
{
return switchState;
+}
+
+QEvent::Type QMeeGoSwitchEvent::eventNumber()
+{
+ if (switchEventNumber < 0)
+ switchEventNumber = QEvent::registerEventType();
+
+ return (QEvent::Type) switchEventNumber;
} \ No newline at end of file