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
11QT_BEGIN_NAMESPACE
12
13class QAbstractItemView;
14
15class ItemViewFindWidget : public AbstractFindWidget
16{
17 Q_OBJECT
18
19public:
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
27protected:
28 void deactivate() override;
29 void find(const QString &textToFind, bool skipCurrent,
30 bool backward, bool *found, bool *wrapped) override;
31
32private:
33 QModelIndex findHelper(const QString &textToFind, bool skipCurrent, bool backward,
34 QModelIndex parent, int row, int column);
35
36 QAbstractItemView *m_itemView;
37};
38
39QT_END_NAMESPACE
40
41#endif // ITEMVIEWFINDWIDGET_H
42

source code of qttools/src/shared/findwidget/itemviewfindwidget.h