~zeal-developers/zeal/master

« back to all changes in this revision

Viewing changes to src/ui/widgets/zealsearchedit.h

  • Committer: Oleg Shparber
  • Date: 2015-01-12 03:51:13 UTC
  • Revision ID: git-v1:792a35241c995b7f5913ee426f4bf5aa706b43d9
Move .pro file to the top, rename zeal dir into src

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ZEALSEARCHEDIT_H
 
2
#define ZEALSEARCHEDIT_H
 
3
 
 
4
#include <QEvent>
 
5
#include <QTreeView>
 
6
#include <QCompleter>
 
7
#include <QLabel>
 
8
#include <QLineEdit>
 
9
 
 
10
class ZealSearchEdit : public QLineEdit
 
11
{
 
12
    Q_OBJECT
 
13
public:
 
14
    explicit ZealSearchEdit(QWidget *parent = 0);
 
15
    void setTreeView(QTreeView *view);
 
16
    void clearQuery();
 
17
    void selectQuery();
 
18
    void setCompletions(const QStringList &completions);
 
19
 
 
20
protected:
 
21
    bool eventFilter(QObject *obj, QEvent *ev);
 
22
    void focusInEvent(QFocusEvent *);
 
23
    void keyPressEvent(QKeyEvent *keyEvent);
 
24
    void mousePressEvent(QMouseEvent *ev);
 
25
    void resizeEvent(QResizeEvent *ev);
 
26
 
 
27
signals:
 
28
 
 
29
public slots:
 
30
    void clear();
 
31
    QString currentCompletion(const QString &text);
 
32
    void showCompletions(const QString &text);
 
33
 
 
34
private:
 
35
    int queryStart();
 
36
 
 
37
    QCompleter *prefixCompleter;
 
38
    QTreeView *treeView;
 
39
    QLabel *completionLabel;
 
40
    bool focusing;
 
41
};
 
42
 
 
43
#endif // ZEALSEARCHEDIT_H