mysortfilterproxymodel.h
changeset 795 6b0a5f4923d3
child 802 f076fdec767d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mysortfilterproxymodel.h	Thu Sep 17 09:41:09 2009 +0000
     1.3 @@ -0,0 +1,70 @@
     1.4 +/****************************************************************************
     1.5 +**
     1.6 +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +** Contact: Qt Software Information (qt-info@nokia.com)
     1.8 +**
     1.9 +** This file is part of the example classes of the Qt Toolkit.
    1.10 +**
    1.11 +** Commercial Usage
    1.12 +** Licensees holding valid Qt Commercial licenses may use this file in
    1.13 +** accordance with the Qt Commercial License Agreement provided with the
    1.14 +** Software or, alternatively, in accordance with the terms contained in
    1.15 +** a written agreement between you and Nokia.
    1.16 +**
    1.17 +**
    1.18 +** GNU General Public License Usage
    1.19 +** Alternatively, this file may be used under the terms of the GNU
    1.20 +** General Public License versions 2.0 or 3.0 as published by the Free
    1.21 +** Software Foundation and appearing in the file LICENSE.GPL included in
    1.22 +** the packaging of this file.  Please review the following information
    1.23 +** to ensure GNU General Public Licensing requirements will be met:
    1.24 +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
    1.25 +** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
    1.26 +** exception, Nokia gives you certain additional rights. These rights
    1.27 +** are described in the Nokia Qt GPL Exception version 1.3, included in
    1.28 +** the file GPL_EXCEPTION.txt in this package.
    1.29 +**
    1.30 +** Qt for Windows(R) Licensees
    1.31 +** As a special exception, Nokia, as the sole copyright holder for Qt
    1.32 +** Designer, grants users of the Qt/Eclipse Integration plug-in the
    1.33 +** right for the Qt/Eclipse Integration to link to functionality
    1.34 +** provided by Qt Designer and its related libraries.
    1.35 +**
    1.36 +** If you are unsure which license is appropriate for your use, please
    1.37 +** contact the sales department at qt-sales@nokia.com.
    1.38 +**
    1.39 +****************************************************************************/
    1.40 +
    1.41 +#ifndef MYSORTFILTERPROXYMODEL_H
    1.42 +#define MYSORTFILTERPROXYMODEL_H
    1.43 +
    1.44 +#include <QDate>
    1.45 +#include <QSortFilterProxyModel>
    1.46 +
    1.47 +//! [0]
    1.48 +class MySortFilterProxyModel : public QSortFilterProxyModel
    1.49 +{
    1.50 +    Q_OBJECT
    1.51 +
    1.52 +public:
    1.53 +    MySortFilterProxyModel(QObject *parent = 0);
    1.54 +
    1.55 + //   QDate filterMinimumDate() const { return minDate; }
    1.56 +//    void setFilterMinimumDate(const QDate &date);
    1.57 +
    1.58 +//    QDate filterMaximumDate() const { return maxDate; }
    1.59 +//    void setFilterMaximumDate(const QDate &date);
    1.60 +
    1.61 +protected:
    1.62 +    bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
    1.63 +//    bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
    1.64 +
    1.65 +private:
    1.66 +    bool dateInRange(const QDate &date) const;
    1.67 +
    1.68 +    QDate minDate;
    1.69 +    QDate maxDate;
    1.70 +};
    1.71 +//! [0]
    1.72 +
    1.73 +#endif