diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-06-09 14:04:34 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-06-10 09:31:38 +0000 |
commit | 72c83463f18f09e390818844bc183b9368b253c9 (patch) | |
tree | 03110ca6e66fbd622eff164078aa1709d90f46d5 /src/libs/utils/categorysortfiltermodel.h | |
parent | b1393d4778056f218f8a02cb529919a08e211fd5 (diff) |
Move sort filter proxy model with category logic to utils
It is useful for other tree models as well.
Change-Id: I48262c266229a91d61579ec1dc068fc18bc33ee0
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/libs/utils/categorysortfiltermodel.h')
-rw-r--r-- | src/libs/utils/categorysortfiltermodel.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/libs/utils/categorysortfiltermodel.h b/src/libs/utils/categorysortfiltermodel.h new file mode 100644 index 00000000000..11d40de5540 --- /dev/null +++ b/src/libs/utils/categorysortfiltermodel.h @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef CATEGORYSORTFILTERMODEL_H +#define CATEGORYSORTFILTERMODEL_H + +#include "utils_global.h" + +#include <QSortFilterProxyModel> + +namespace Utils { + +class QTCREATOR_UTILS_EXPORT CategorySortFilterModel : public QSortFilterProxyModel +{ +public: + CategorySortFilterModel(QObject *parent = 0); + +protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; +}; + +} // Utils + +#endif // CATEGORYSORTFILTERMODEL_H |