1 /* 2 * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 3 * 4 * This file is part of the KD Chart library. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <https://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef KCHARTABSTRACTPROXYMODEL_H 21 #define KCHARTABSTRACTPROXYMODEL_H 22 23 #include <QAbstractProxyModel> 24 25 #include "KChartGlobal.h" 26 27 namespace KChart 28 { 29 /** 30 * @brief Base class for all proxy models used inside KChart 31 * \internal 32 */ 33 class KCHART_EXPORT AbstractProxyModel : public QAbstractProxyModel 34 { 35 Q_OBJECT 36 public: 37 38 /** This is basically KDAbstractProxyModel, but only the 39 bits that we really need from it */ 40 explicit AbstractProxyModel( QObject* parent = nullptr ); 41 42 /*! \reimpl */ 43 QModelIndex mapFromSource( const QModelIndex & sourceIndex ) const override; 44 /*! \reimpl */ 45 QModelIndex mapToSource( const QModelIndex &proxyIndex ) const override; 46 47 /*! \reimpl */ 48 QModelIndex index( int row, int col, const QModelIndex& index ) const override; 49 /*! \reimpl */ 50 QModelIndex parent( const QModelIndex& index ) const override; 51 }; 52 } 53 54 #endif /* KCHARTABSTRACTPROXYMODEL_H */ 55