PageRenderTime 15ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 4#include <QxtHttpServerConnector>
 5#include <QxtHttpSessionManager>
 6#include <QxtWebSlotService>
 7#include <QxtWebPageEvent>
 8
 9
10class MyService : public QxtWebSlotService{
11    Q_OBJECT;
12public:
13    MyService(QxtAbstractWebSessionManager * sm, QObject * parent = 0 ): QxtWebSlotService(sm,parent){
14    }
15public slots:
16    void index(QxtWebRequestEvent* event)
17    {
18        postEvent(new QxtWebPageEvent(event->sessionID, event->requestID, "<h1>It Works!</h1>"));
19    }
20};
21
22#endif
23