/thirdparty/qxt/qxtweb-standalone/example/myservice.h

http://github.com/tomahawk-player/tomahawk · C Header · 23 lines · 18 code · 5 blank · 0 comment · 0 complexity · f94723d96aedacf1f095e387aea8b356 MD5 · raw file

  1. #ifndef MYSERVICE
  2. #define MYSERVICE
  3. #include <QxtHttpServerConnector>
  4. #include <QxtHttpSessionManager>
  5. #include <QxtWebSlotService>
  6. #include <QxtWebPageEvent>
  7. class MyService : public QxtWebSlotService{
  8. Q_OBJECT;
  9. public:
  10. MyService(QxtAbstractWebSessionManager * sm, QObject * parent = 0 ): QxtWebSlotService(sm,parent){
  11. }
  12. public slots:
  13. void index(QxtWebRequestEvent* event)
  14. {
  15. postEvent(new QxtWebPageEvent(event->sessionID, event->requestID, "<h1>It Works!</h1>"));
  16. }
  17. };
  18. #endif