From 96c3b5c064a26b8598943a122d9b6ecbdf1062e9 Mon Sep 17 00:00:00 2001 From: senator Date: Mon, 17 Mar 2008 11:29:52 +0000 Subject: recent changes, dunno what exactly, but perhaps something with moving on to next dialog by clicking next --- client/macro.cc | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'client/macro.cc') diff --git a/client/macro.cc b/client/macro.cc index ec520f0..654557d 100644 --- a/client/macro.cc +++ b/client/macro.cc @@ -28,10 +28,22 @@ #include "builder.h" #include "sendrecieve.h" #include +#include + +#define MY_EVENT_ID 65432 + +class MyEvent : public QEvent { +public: + MyEvent(QString macro) : QEvent((QEvent::Type)MY_EVENT_ID) + { + this->macro = macro; + } + QString macro; +}; static QDomDocument xml_request(QString name); -void macro(QString name) +void create_macro(QString name) { // Build the XML request QDomDocument xml_req = xml_request(name); @@ -55,6 +67,26 @@ void macro(QString name) Builder *builder = new Builder(&xml_doc); } +bool MyEventHandler::eventFilter( QObject *o, QEvent *e ) +{ + + if ( e->type() == MY_EVENT_ID ) { + MyEvent *event = (MyEvent*)e; + create_macro(event->macro); + // ... DO SOMETHING WITH EVENT + return TRUE; // eat event + } else { + // standard event processing + return FALSE; + } +} + +void new_macro(QString macro) +{ + MyEvent *event = new MyEvent(macro); + qApp->postEvent(qApp, event); +} + static QDomDocument xml_request(QString name) { // Create the xml request array -- cgit v1.2.3