2
0

example-qt.h 620 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __HIREDIS_EXAMPLE_QT_H
  2. #define __HIREDIS_EXAMPLE_QT_H
  3. #include <adapters/qt.h>
  4. class ExampleQt : public QObject {
  5. Q_OBJECT
  6. public:
  7. ExampleQt(const char * value, QObject * parent = 0)
  8. : QObject(parent), m_value(value) {}
  9. signals:
  10. void finished();
  11. public slots:
  12. void run();
  13. private:
  14. void finish() { emit finished(); }
  15. private:
  16. const char * m_value;
  17. redisAsyncContext * m_ctx;
  18. RedisQtAdapter m_adapter;
  19. friend
  20. void getCallback(redisAsyncContext *, void *, void *);
  21. };
  22. #endif /* !__HIREDIS_EXAMPLE_QT_H */