Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
itemviewfindwidget_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists for the convenience
10// of Qt Designer. This header file may change from version to version
11// without notice, or even be removed.
12//
13// We mean it.
14//
15
16#ifndef ITEMVIEWFINDWIDGET_H
17#define ITEMVIEWFINDWIDGET_H
18
20
21#include <QModelIndex>
22
23QT_BEGIN_NAMESPACE
24
25class QAbstractItemView;
26
28{
30
31public:
32 explicit ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = nullptr);
33
35 { return m_itemView; }
36
37 void setItemView(QAbstractItemView *itemView);
38
39protected:
40 void deactivate() override;
41 void find(const QString &textToFind, bool skipCurrent,
42 bool backward, bool *found, bool *wrapped) override;
43
44private:
45 QModelIndex findHelper(const QString &textToFind, bool skipCurrent, bool backward,
46 QModelIndex parent, int row, int column);
47
48 QAbstractItemView *m_itemView;
49};
50
51QT_END_NAMESPACE
52
53#endif // ITEMVIEWFINDWIDGET_H
A search bar that is commonly added below a searchable widget.
virtual void deactivate()
Deactivates the find widget, making it invisible and handing focus to any associated QTextEdit.
A search bar that is commonly added below the searchable item view.
void setItemView(QAbstractItemView *itemView)
Associates a QAbstractItemView with this find widget.
QAbstractItemView * itemView() const
void find(const QString &textToFind, bool skipCurrent, bool backward, bool *found, bool *wrapped) override
\reimp
void deactivate() override
\reimp
static bool skipForward(const QAbstractItemModel *model, QModelIndex &parent, int &row, int &column)
static bool skipBackward(const QAbstractItemModel *model, QModelIndex &parent, int &row, int &column)
static bool indexLessThan(const QModelIndex &a, const QModelIndex &b)