Ok, the long awaited config wizard is here (at least in a very basic state). There...
[quassel.git] / src / contrib / libqxt-2007-10-24 / tests / web / async / main.cpp
1 #include <QCoreApplication>
2 #include <QxtWebCore>
3 #include <QxtWebController>
4 #include <QxtScgiConnector>
5 #include <QTimer>
6 class test : public QxtWebController
7         {
8         Q_OBJECT
9         public:
10                 test():QxtWebController("root")
11                         {
12                         }
13
14         public slots:
15
16                  int index()
17                         {
18                         QTimer::singleShot(20,this,SLOT(async()));
19                         echo()<<"foo";
20                         return 2;
21                         }
22         private slots:
23                 
24                 void async()
25                         {
26                         QxtWebCore::send("bar");
27                         QxtWebCore::close();
28                         }
29
30         };
31
32 class err : public QxtWebController
33         {
34         Q_OBJECT
35         public:
36                 err():QxtWebController("error")
37                         {
38                         }
39
40         public slots:
41
42                  int index(QString a=QString("500"),QString b=QString(),QString c=QString(),QString d=QString(),
43                         QString e=QString(),QString f=QString(),QString g=QString())
44                         {
45                         echo()<<"shits<br/>"
46                         "error "<<a<<"<br/>"
47                         <<b<<"<br/>"
48                         <<c<<"<br/>"
49                         <<d<<"<br/>"
50                         <<e<<"<br/>"
51                         <<f<<"<br/>"
52                         <<g<<"<br/>";
53                         return 0;
54                         }
55
56         };
57
58
59
60
61
62 int main(int argc, char *argv[])
63         {
64         QCoreApplication app(argc, argv);
65         QxtWebCore core(new QxtScgiConnector());
66         core.start(4000);
67         test t;
68         err e;
69         return app.exec();
70         }
71
72
73 #include "main.moc"