1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef ITEMVIEWFINDWIDGET_H |
5 | #define ITEMVIEWFINDWIDGET_H |
6 | |
7 | #include "abstractfindwidget.h" |
8 | |
9 | #include <QModelIndex> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QAbstractItemView; |
14 | |
15 | class ItemViewFindWidget : public AbstractFindWidget |
16 | { |
17 | Q_OBJECT |
18 | |
19 | public: |
20 | explicit ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0); |
21 | |
22 | QAbstractItemView *itemView() const |
23 | { return m_itemView; } |
24 | |
25 | void setItemView(QAbstractItemView *itemView); |
26 | |
27 | protected: |
28 | void deactivate() override; |
29 | void find(const QString &textToFind, bool skipCurrent, |
30 | bool backward, bool *found, bool *wrapped) override; |
31 | |
32 | private: |
33 | QModelIndex findHelper(const QString &textToFind, bool skipCurrent, bool backward, |
34 | QModelIndex parent, int row, int column); |
35 | |
36 | QAbstractItemView *m_itemView; |
37 | }; |
38 | |
39 | QT_END_NAMESPACE |
40 | |
41 | #endif // ITEMVIEWFINDWIDGET_H |
42 | |