summaryrefslogtreecommitdiffabout
path: root/microkde/klineedit.h
blob: 9eb749d85190ac896a7e5815684815a4994f1355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef MINIKDE_KLINEEDIT_H
#define MINIKDE_KLINEEDIT_H

#include <qlineedit.h>
//Added by qt3to4:
#include <QKeyEvent>

#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#endif


class KLineEdit : public QLineEdit
{
    
  Q_OBJECT

  public:
    KLineEdit( QWidget *parent=0, const char *name=0 ) :
      QLineEdit( parent, name ) 
        {
#ifndef DESKTOP_VERSION
    QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
#endif
        }
        void keyPressEvent ( QKeyEvent * e) 
        {
            switch ( e->key() ) {
            case Qt::Key_Down:
                emit scrollDOWN();
                e->accept();
                break; 
            case Qt::Key_Up:
                emit scrollUP();
                e->accept();
                break; 
            default:
                QLineEdit::keyPressEvent ( e );
                break;
            }
            
        }
    void setTrapReturnKey( bool ) {}
 signals:
    void scrollUP();
    void scrollDOWN();
};

#endif