quickdialog.h 790 Bytes
Newer Older
Waqar Ahmed's avatar
Waqar Ahmed committed
1
2
3
4
5
/*
    SPDX-FileCopyrightText: 2021 Waqar Ahmed <waqar.17a@gmail.com>

    SPDX-License-Identifier: LGPL-2.0-or-later
*/
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef QUICKDIALOG_H
#define QUICKDIALOG_H

#include <QLineEdit>
#include <QMenu>
#include <QPointer>
#include <QSortFilterProxyModel>
#include <QTreeView>

class QAbstractItemModel;
namespace KTextEditor
{
class MainWindow;
}

class QuickDialog : public QMenu
{
    Q_OBJECT
public:
25
    QuickDialog(QWidget *parent, QWidget *mainWindow);
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

protected:
    bool eventFilter(QObject *obj, QEvent *event) override;
    void updateViewGeometry();
    void clearLineEdit();

protected Q_SLOTS:
    virtual void slotReturnPressed() = 0;

protected:
    QTreeView m_treeView;
    QLineEdit m_lineEdit;

private:
    QPointer<QWidget> m_mainWindow;
};

#endif // QUICKDIALOG_H