summaryrefslogtreecommitdiff
path: root/examples/example-qt.h
diff options
context:
space:
mode:
authorPietro Cerutti <gahr@gahr.ch>2014-06-17 15:42:07 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2015-07-27 23:17:41 +0200
commit8ef7d595acd9f4263aa9720dfc57712bbf2cdb33 (patch)
tree604d63c3027e7b8ee300041b0134e0a461636adf /examples/example-qt.h
parent3b153cbf9dda2c61af26ad8df2a31b8a5d6a38c8 (diff)
Add Qt adapter and relative example.
Diffstat (limited to 'examples/example-qt.h')
-rw-r--r--examples/example-qt.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/example-qt.h b/examples/example-qt.h
new file mode 100644
index 0000000..1136f54
--- /dev/null
+++ b/examples/example-qt.h
@@ -0,0 +1,32 @@
+#ifndef __HIREDIS_EXAMPLE_QT_H
+#define __HIREDIS_EXAMPLE_QT_H
+
+#include <adapters/qt.h>
+
+class ExampleQt : public QObject {
+
+ Q_OBJECT
+
+ public:
+ ExampleQt(const char * value, QObject * parent = 0)
+ : QObject(parent), m_value(value) {}
+
+ signals:
+ void finished();
+
+ public slots:
+ void run();
+
+ private:
+ void finish() { emit finished(); }
+
+ private:
+ const char * m_value;
+ redisAsyncContext * m_ctx;
+ RedisQtAdapter m_adapter;
+
+ friend
+ void getCallback(redisAsyncContext *, void *, void *);
+};
+
+#endif /* !__HIREDIS_EXAMPLE_QT_H */