File indexing completed on 2024-05-12 04:20:44
0001 /* 0002 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 0003 * 0004 * This file is part of the KGantt library. 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KGANTTPROXYMODEL_H 0010 #define KGANTTPROXYMODEL_H 0011 0012 #include "kganttforwardingproxymodel.h" 0013 0014 namespace KGantt { 0015 class KGANTT_EXPORT ProxyModel : public ForwardingProxyModel { 0016 Q_OBJECT 0017 Q_DISABLE_COPY(ProxyModel) 0018 KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( ProxyModel ) 0019 public: 0020 explicit ProxyModel( QObject* parent = nullptr ); 0021 ~ProxyModel() override; 0022 0023 void setColumn( int ganttrole, int col ); 0024 void removeColumn( int ganttrole ); 0025 void setRole( int ganttrole, int role ); 0026 void removeRole( int ganttrole ); 0027 0028 int column( int ganttrole ) const; 0029 int role( int ganttrole ) const; 0030 0031 #if 0 0032 void setCalendarMode( bool enable ); 0033 bool calendarMode() const; 0034 #endif 0035 0036 /*reimp*/ QModelIndex mapFromSource( const QModelIndex& idx) const override; 0037 /*reimp*/ QModelIndex mapToSource( const QModelIndex& proxyIdx ) const override; 0038 0039 /*reimp*/ int rowCount( const QModelIndex& idx ) const override; 0040 /*reimp*/ int columnCount( const QModelIndex& idx ) const override; 0041 0042 /*reimp*/ QVariant data( const QModelIndex& idx, int role = Qt::DisplayRole ) const override; 0043 /*reimp*/ bool setData( const QModelIndex& idx, const QVariant& value, int role=Qt::EditRole ) override; 0044 }; 0045 } 0046 0047 #endif /* KGANTTPROXYMODEL_H */ 0048