summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/main.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/main.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
index eafc9b2..58c9c57 100644
--- a/noncore/apps/opie-console/main.cpp
+++ b/noncore/apps/opie-console/main.cpp
@@ -1,8 +1,39 @@
1#include <opie2/oapplicationfactory.h> 1#include <opie2/oapplication.h>
2#include <qwsevent_qws.h>
2 3
3#include "mainwindow.h" 4#include "mainwindow.h"
4 5
6class OConsoleApplication : public Opie::Core::OApplication {
7public:
8 OConsoleApplication(int argc, char* argv[]);
9protected:
10 bool qwsEventFilter( QWSEvent * );
11};
5 12
6OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ); 13OConsoleApplication::OConsoleApplication(int argc, char* argv[] )
14 : Opie::Core::OApplication(argc, argv, "opie-console")
15{}
7 16
17bool OConsoleApplication::qwsEventFilter( QWSEvent *e) {
18 if( e->type == QWSEvent::Key ) {
19 QWSKeyEvent *key = static_cast<QWSKeyEvent*>(e);
20
21 /* prevent QPEApplication to filter the key */
22 if(key->simpleData.keycode == Qt::Key_Escape)
23 return QApplication::qwsEventFilter(e);
24
25 }
26
27 return Opie::Core::OApplication::qwsEventFilter( e);
28}
29
30
31int main(int argc, char* argv[]) {
32 OConsoleApplication app(argc, argv);
33
34 MainWindow win;
35 app.showMainWidget(&win);
36
37 return app.exec();
38}
8 39