Mercurial > retraceit
view src/includeemptysortmodel.h @ 113:20ec21924338 tip
Added tag 1.4 for changeset 9daf778feaf1
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 08 Dec 2016 15:34:30 +0100 |
parents | 07e1e47954f6 |
children |
line wrap: on
line source
#ifndef INCLUDEEMPTYSORTMODEL_H #define INCLUDEEMPTYSORTMODEL_H /* Copyright (C) 2015 by ETH Zürich * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=2) * and comes with ABSOLUTELY NO WARRANTY! * See LICENSE.txt for details. */ /** * @file metadataview.h * @brief Table view of the meta data information */ /** * @class IncludeEmptySortModel * @brief Small wrapper around sort filter model to allow custom filtering */ #include <QModelIndex> #include <QSortFilterProxyModel> class IncludeEmptySortModel : public QSortFilterProxyModel { Q_OBJECT public: IncludeEmptySortModel() : QSortFilterProxyModel(), mIncludeEmpty(true) {} /** @brief wrapper around the base class call that accepts empty * values if includeEmpty is checked. */ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; public slots: void setIncludeEmpty(int state) { mIncludeEmpty = state != Qt::Unchecked; invalidate(); } private: bool mIncludeEmpty; }; #endif // INCLUDEEMPTYSORTMODEL_H