insilmaril@795: /**************************************************************************** insilmaril@795: ** insilmaril@795: ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). insilmaril@795: ** Contact: Qt Software Information (qt-info@nokia.com) insilmaril@795: ** insilmaril@795: ** This file is part of the example classes of the Qt Toolkit. insilmaril@795: ** insilmaril@795: ** Commercial Usage insilmaril@795: ** Licensees holding valid Qt Commercial licenses may use this file in insilmaril@795: ** accordance with the Qt Commercial License Agreement provided with the insilmaril@795: ** Software or, alternatively, in accordance with the terms contained in insilmaril@795: ** a written agreement between you and Nokia. insilmaril@795: ** insilmaril@795: ** insilmaril@795: ** GNU General Public License Usage insilmaril@795: ** Alternatively, this file may be used under the terms of the GNU insilmaril@795: ** General Public License versions 2.0 or 3.0 as published by the Free insilmaril@795: ** Software Foundation and appearing in the file LICENSE.GPL included in insilmaril@795: ** the packaging of this file. Please review the following information insilmaril@795: ** to ensure GNU General Public Licensing requirements will be met: insilmaril@795: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and insilmaril@795: ** http://www.gnu.org/copyleft/gpl.html. In addition, as a special insilmaril@795: ** exception, Nokia gives you certain additional rights. These rights insilmaril@795: ** are described in the Nokia Qt GPL Exception version 1.3, included in insilmaril@795: ** the file GPL_EXCEPTION.txt in this package. insilmaril@795: ** insilmaril@795: ** Qt for Windows(R) Licensees insilmaril@795: ** As a special exception, Nokia, as the sole copyright holder for Qt insilmaril@795: ** Designer, grants users of the Qt/Eclipse Integration plug-in the insilmaril@795: ** right for the Qt/Eclipse Integration to link to functionality insilmaril@795: ** provided by Qt Designer and its related libraries. insilmaril@795: ** insilmaril@795: ** If you are unsure which license is appropriate for your use, please insilmaril@795: ** contact the sales department at qt-sales@nokia.com. insilmaril@795: ** insilmaril@795: ****************************************************************************/ insilmaril@795: insilmaril@795: #ifndef MYSORTFILTERPROXYMODEL_H insilmaril@795: #define MYSORTFILTERPROXYMODEL_H insilmaril@795: insilmaril@795: #include insilmaril@795: #include insilmaril@795: insilmaril@795: //! [0] insilmaril@795: class MySortFilterProxyModel : public QSortFilterProxyModel insilmaril@795: { insilmaril@795: Q_OBJECT insilmaril@795: insilmaril@795: public: insilmaril@795: MySortFilterProxyModel(QObject *parent = 0); insilmaril@795: insilmaril@795: // QDate filterMinimumDate() const { return minDate; } insilmaril@795: // void setFilterMinimumDate(const QDate &date); insilmaril@795: insilmaril@795: // QDate filterMaximumDate() const { return maxDate; } insilmaril@795: // void setFilterMaximumDate(const QDate &date); insilmaril@795: insilmaril@795: protected: insilmaril@795: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; insilmaril@795: // bool lessThan(const QModelIndex &left, const QModelIndex &right) const; insilmaril@795: insilmaril@795: private: insilmaril@795: bool dateInRange(const QDate &date) const; insilmaril@795: insilmaril@795: QDate minDate; insilmaril@795: QDate maxDate; insilmaril@795: }; insilmaril@795: //! [0] insilmaril@795: insilmaril@795: #endif