summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--navit/graphics/qt5/event_qt5.cpp11
-rw-r--r--navit/graphics/qt5/event_qt5.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/navit/graphics/qt5/event_qt5.cpp b/navit/graphics/qt5/event_qt5.cpp
index 5eae821f6..08fb6e525 100644
--- a/navit/graphics/qt5/event_qt5.cpp
+++ b/navit/graphics/qt5/event_qt5.cpp
@@ -43,6 +43,7 @@ extern "C" {
#if defined(WINDOWS) || defined(WIN32) || defined(HAVE_API_WIN32_CE)
#include <windows.h>
#endif
+
#include "event_qt5.h"
#include "event_qt5.moc"
#include "graphics_qt5.h"
@@ -65,6 +66,16 @@ qt5_navit_timer::qt5_navit_timer(QObject* parent)
dbg(lvl_debug, "qt5_navit_timer object created\n");
}
+void qt5_navit_timer::watchEvent(int id)
+{
+ struct event_watch* ret = g_new0(struct event_watch, 1);
+ ret = (struct event_watch*)g_hash_table_lookup(watches, (void*)(long)id);
+ if (ret) {
+ dbg(lvl_debug, "callback found, calling it\n");
+ callback_call_0(ret->cb);
+ }
+}
+
void qt5_navit_timer::timerEvent(QTimerEvent* event)
{
int id = event->timerId();
diff --git a/navit/graphics/qt5/event_qt5.h b/navit/graphics/qt5/event_qt5.h
index 59f168a9c..892e8fca8 100644
--- a/navit/graphics/qt5/event_qt5.h
+++ b/navit/graphics/qt5/event_qt5.h
@@ -29,6 +29,9 @@ public:
GHashTable* timer_callback;
GHashTable* watches;
+public slots:
+ void watchEvent(int id);
+
protected:
void timerEvent(QTimerEvent* event);
};