Add credits for Marek
[trojita.git] / src / Gui / LineEdit.h
blob148e5fae10d6e9243ab1d0c111fad5a1aedc4300
1 /****************************************************************************
2 **
3 ** Copyright (c) 2007 Trolltech ASA <info@trolltech.com>
4 ** Modified (c) 2009, 2011, 2013 by Glad Deschrijver <glad.deschrijver@gmail.com>
5 **
6 ** Use, modification and distribution is allowed without limitation,
7 ** warranty, liability or support of any kind.
8 **
9 ****************************************************************************/
11 #ifndef LINEEDIT_H
12 #define LINEEDIT_H
14 #include <QLineEdit>
16 class QToolButton;
18 class LineEdit : public QLineEdit
20 Q_OBJECT
22 public:
23 explicit LineEdit(const QString &text, QWidget *parent = 0);
24 explicit LineEdit(QWidget *parent = 0);
25 bool isHistoryEnabled();
26 void setHistoryEnabled(bool enabled = true);
28 signals:
29 void textEditingFinished(const QString &text);
30 void escapePressed();
32 protected:
33 bool eventFilter(QObject *o, QEvent *e);
34 void keyReleaseEvent(QKeyEvent *ke);
36 private Q_SLOTS:
37 void learnEntry();
38 void restoreInlineCompletion();
40 private:
41 bool m_historyEnabled;
42 int m_historyPosition;
43 QString m_currentText;
46 #endif // LINEEDIT_H