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
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
19
20#include <QModelIndex>
21
22QT_BEGIN_NAMESPACE
23
24class QAbstractItemView;
25
27{
29
30public:
32
34 { return m_itemView; }
35
36 void setItemView(QAbstractItemView *itemView);
37
38protected:
39 void deactivate() override;
40 void find(const QString &textToFind, bool skipCurrent,
41 bool backward, bool *found, bool *wrapped) override;
42
43private:
44 QModelIndex findHelper(const QString &textToFind, bool skipCurrent, bool backward,
45 QModelIndex parent, int row, int column);
46
47 QAbstractItemView *m_itemView;
48};
49
50QT_END_NAMESPACE
51
52#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)