| 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 | // | 
| 5 | //  W A R N I N G | 
| 6 | //  ------------- | 
| 7 | // | 
| 8 | // This file is not part of the Qt API. It exists for the convenience | 
| 9 | // of Qt Designer. This header file may change from version to version | 
| 10 | // without notice, or even be removed. | 
| 11 | // | 
| 12 | // We mean it. | 
| 13 | // | 
| 14 |  | 
| 15 | #ifndef ITEMVIEWFINDWIDGET_H | 
| 16 | #define ITEMVIEWFINDWIDGET_H | 
| 17 |  | 
| 18 | #include "abstractfindwidget_p.h" | 
| 19 |  | 
| 20 | #include <QModelIndex> | 
| 21 |  | 
| 22 | QT_BEGIN_NAMESPACE | 
| 23 |  | 
| 24 | class QAbstractItemView; | 
| 25 |  | 
| 26 | class ItemViewFindWidget : public AbstractFindWidget | 
| 27 | { | 
| 28 |     Q_OBJECT | 
| 29 |  | 
| 30 | public: | 
| 31 |     explicit ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0); | 
| 32 |  | 
| 33 |     QAbstractItemView *itemView() const | 
| 34 |     { return m_itemView; } | 
| 35 |  | 
| 36 |     void setItemView(QAbstractItemView *itemView); | 
| 37 |  | 
| 38 | protected: | 
| 39 |     void deactivate() override; | 
| 40 |     void find(const QString &textToFind, bool skipCurrent, | 
| 41 |               bool backward, bool *found, bool *wrapped) override; | 
| 42 |  | 
| 43 | private: | 
| 44 |     QModelIndex findHelper(const QString &textToFind, bool skipCurrent, bool backward, | 
| 45 |         QModelIndex parent, int row, int column); | 
| 46 |  | 
| 47 |     QAbstractItemView *m_itemView; | 
| 48 | }; | 
| 49 |  | 
| 50 | QT_END_NAMESPACE | 
| 51 |  | 
| 52 | #endif  // ITEMVIEWFINDWIDGET_H | 
| 53 |  |