1 /****************************************************************************
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
6 ** This file is part of the QtBrowser project.
8 ** $QT_BEGIN_LICENSE:GPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 2 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.GPLv2 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU General Public License version 2 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 3.0 as published by the Free Software
28 ** Foundation and appearing in the file LICENSE.GPL included in the
29 ** packaging of this file. Please review the following information to
30 ** ensure the GNU General Public License version 3.0 requirements will be
31 ** met: http://www.gnu.org/copyleft/gpl.html.
36 ****************************************************************************/
38 #ifndef NAVIGATIONHISTORYPROXYMODEL_H
39 #define NAVIGATIONHISTORYPROXYMODEL_H
42 #include <QAbstractItemModel>
43 #include <QSortFilterProxyModel>
45 class NavigationHistoryProxyModel : public QSortFilterProxyModel
49 Q_PROPERTY(QAbstractItemModel * target READ sourceModel WRITE setSourceModel)
50 Q_PROPERTY(QString searchString READ searchString WRITE setSearchString NOTIFY searchStringChanged)
51 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
54 explicit NavigationHistoryProxyModel(QObject *parent = 0);
57 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
59 bool enabled() const { return dynamicSortFilter(); }
60 void setEnabled(bool enabled);
62 void setTarget(QAbstractItemModel *t);
64 QString searchString() const ;
65 void setSearchString(const QString &pattern);
68 void searchStringChanged();
69 void enabledChanged();
72 QString m_searchString;
75 #endif // NAVIGATIONHISTORYPROXYMODEL_H