KD Chart API Documentation  3.1
Public Member Functions | Protected Member Functions | List of all members
KDGantt::SummaryHandlingProxyModel Class Reference

Proxy model that supports summary gantt items. More...

#include <kdganttsummaryhandlingproxymodel.h>

Inheritance diagram for KDGantt::SummaryHandlingProxyModel:
KDGantt::ForwardingProxyModel

Public Member Functions

 SummaryHandlingProxyModel (QObject *parent=nullptr)
 Constructor. More...
 
 ~SummaryHandlingProxyModel () override
 
QVariant data (const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &idx) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setSourceModel (QAbstractItemModel *model) override
 Sets the model to be used as the source model for this proxy. More...
 
- Public Member Functions inherited from KDGantt::ForwardingProxyModel
 ForwardingProxyModel (QObject *parent=nullptr)
 Constructor. More...
 
 ~ForwardingProxyModel () override
 
int columnCount (const QModelIndex &idx=QModelIndex()) const override
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex mapFromSource (const QModelIndex &sourceIndex) const override
 Converts indexes in the source model to indexes in the proxy model. More...
 
QModelIndex mapToSource (const QModelIndex &proxyIndex) const override
 Converts indexes in the proxy model to indexes in the source model. More...
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
QModelIndex parent (const QModelIndex &idx) const override
 
int rowCount (const QModelIndex &idx=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setSourceModel (QAbstractItemModel *model) override
 Sets the model to be used as the source model for this proxy. More...
 
Qt::DropActions supportedDropActions () const override
 

Protected Member Functions

void sourceColumnsAboutToBeInserted (const QModelIndex &idx, int start, int end) override
 Called just before columns are inserted into the source model. More...
 
void sourceColumnsAboutToBeRemoved (const QModelIndex &idx, int start, int end) override
 Called just before columns are removed from the source model. More...
 
void sourceDataChanged (const QModelIndex &from, const QModelIndex &to) override
 Called when the data in an existing item in the source model changes. More...
 
void sourceLayoutChanged () override
 Called when the layout of the source model has changed. More...
 
void sourceModelReset () override
 Called when the source model is reset. More...
 
void sourceRowsAboutToBeInserted (const QModelIndex &idx, int start, int end) override
 Called just before rows are inserted into the source model. More...
 
void sourceRowsAboutToBeRemoved (const QModelIndex &, int start, int end) override
 Called just before rows are removed from the source model. More...
 

Additional Inherited Members

- Protected Slots inherited from KDGantt::ForwardingProxyModel
virtual void sourceColumnsInserted (const QModelIndex &idx, int start, int end)
 Called after columns have been inserted into the source model. More...
 
virtual void sourceColumnsRemoved (const QModelIndex &idx, int start, int end)
 Called after columns have been removed from the source model. More...
 
virtual void sourceLayoutAboutToBeChanged ()
 Called just before the layout of the source model is changed. More...
 
virtual void sourceModelAboutToBeReset ()
 Called when the source model is about to be reset. More...
 
virtual void sourceRowsInserted (const QModelIndex &idx, int start, int end)
 Called after rows have been inserted into the source model. More...
 
virtual void sourceRowsRemoved (const QModelIndex &, int start, int end)
 Called after rows have been removed from the source model. More...
 

Detailed Description

Proxy model that supports summary gantt items.

This proxy model provides the functionality of summary items. A summary item is an item with type KDGantt::TypeSummary and zero or more children in the model that it summarizes. GraphicsView itself does not dictate any policy for summary items, instead the logic for making the summary items start and end points span it's children is provided by this proxy.

The start and end times of a summary is the min/max of the start/end times of it's children.

See also
GraphicsView::setModel

Definition at line 17 of file kdganttsummaryhandlingproxymodel.h.

Constructor & Destructor Documentation

◆ SummaryHandlingProxyModel()

SummaryHandlingProxyModel::SummaryHandlingProxyModel ( QObject *  parent = nullptr)
explicit

Constructor.

Creates a new SummaryHandlingProxyModel with parent parent

Definition at line 115 of file kdganttsummaryhandlingproxymodel.cpp.

◆ ~SummaryHandlingProxyModel()

SummaryHandlingProxyModel::~SummaryHandlingProxyModel ( )
override

Definition at line 123 of file kdganttsummaryhandlingproxymodel.cpp.

Member Function Documentation

◆ data()

QVariant SummaryHandlingProxyModel::data ( const QModelIndex &  proxyIndex,
int  role = Qt::DisplayRole 
) const
override

◆ flags()

Qt::ItemFlags SummaryHandlingProxyModel::flags ( const QModelIndex &  idx) const
override
See also
QAbstractItemModel::flags

Definition at line 211 of file kdganttsummaryhandlingproxymodel.cpp.

References d, and KDGantt::ForwardingProxyModel::mapToSource().

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

◆ setData()

bool SummaryHandlingProxyModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

◆ setSourceModel()

void SummaryHandlingProxyModel::setSourceModel ( QAbstractItemModel *  model)
override

Sets the model to be used as the source model for this proxy.

The proxy does not take ownership of the model.

See also
QAbstractProxyModel::setSourceModel

Definition at line 147 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

◆ sourceColumnsAboutToBeInserted()

void SummaryHandlingProxyModel::sourceColumnsAboutToBeInserted ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
overrideprotectedvirtual

Called just before columns are inserted into the source model.

See also
QAbstractItemModel::columnsAboutToBeInserted()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 182 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

◆ sourceColumnsAboutToBeRemoved()

void SummaryHandlingProxyModel::sourceColumnsAboutToBeRemoved ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
overrideprotectedvirtual

Called just before columns are removed from the source model.

See also
QAbstractItemModel::columnsAboutToBeRemoved()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 190 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

◆ sourceDataChanged()

void SummaryHandlingProxyModel::sourceDataChanged ( const QModelIndex &  from,
const QModelIndex &  to 
)
overrideprotectedvirtual

Called when the data in an existing item in the source model changes.

See also
QAbstractItemModel::dataChanged()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 165 of file kdganttsummaryhandlingproxymodel.cpp.

References d, KDGantt::ItemTypeRole, KDGantt::ForwardingProxyModel::mapFromSource(), and KDGantt::TypeSummary.

◆ sourceLayoutChanged()

void SummaryHandlingProxyModel::sourceLayoutChanged ( )
overrideprotectedvirtual

Called when the layout of the source model has changed.

See also
QAbstractItemModel::layoutChanged()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 159 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

◆ sourceModelReset()

void SummaryHandlingProxyModel::sourceModelReset ( )
overrideprotectedvirtual

Called when the source model is reset.

See also
QAbstractItemModel::modelReset()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 153 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

◆ sourceRowsAboutToBeInserted()

void SummaryHandlingProxyModel::sourceRowsAboutToBeInserted ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
overrideprotectedvirtual

Called just before rows are inserted into the source model.

See also
QAbstractItemModel::rowsAboutToBeInserted()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 198 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

◆ sourceRowsAboutToBeRemoved()

void SummaryHandlingProxyModel::sourceRowsAboutToBeRemoved ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
overrideprotectedvirtual

Called just before rows are removed from the source model.

See also
QAbstractItemModel::rowsAboutToBeRemoved()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 204 of file kdganttsummaryhandlingproxymodel.cpp.

References d.


The documentation for this class was generated from the following files:

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated by doxygen 1.9.1