KD Chart 2  [rev.2.7]
Public Member Functions | Protected Slots | 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:
Inheritance graph
[legend]
Collaboration diagram for KDGantt::SummaryHandlingProxyModel:
Collaboration graph
[legend]

Public Member Functions

int columnCount (const QModelIndex &idx=QModelIndex()) const override
 
QVariant data (const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const override
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
Qt::ItemFlags flags (const QModelIndex &idx) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex mapFromSource (const QModelIndex &sourceIndex) const override
 
QModelIndex mapToSource (const QModelIndex &proxyIndex) const override
 
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
 
 SummaryHandlingProxyModel (QObject *parent=0)
 
Qt::DropActions supportedDropActions () const override
 
 ~SummaryHandlingProxyModel () override
 

Protected Slots

virtual void sourceColumnsInserted (const QModelIndex &idx, int start, int end)
 
virtual void sourceColumnsRemoved (const QModelIndex &idx, int start, int end)
 
virtual void sourceLayoutAboutToBeChanged ()
 
virtual void sourceModelAboutToBeReset ()
 
virtual void sourceRowsInserted (const QModelIndex &idx, int start, int end)
 
virtual void sourceRowsRemoved (const QModelIndex &, int start, int end)
 

Protected Member Functions

void sourceColumnsAboutToBeInserted (const QModelIndex &idx, int start, int end) override
 
void sourceColumnsAboutToBeRemoved (const QModelIndex &idx, int start, int end) override
 
void sourceDataChanged (const QModelIndex &from, const QModelIndex &to) override
 
void sourceLayoutChanged () override
 
void sourceModelReset () override
 
void sourceRowsAboutToBeInserted (const QModelIndex &idx, int start, int end) override
 
void sourceRowsAboutToBeRemoved (const QModelIndex &, int start, int end) override
 

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 29 of file kdganttsummaryhandlingproxymodel.h.

Constructor & Destructor Documentation

SummaryHandlingProxyModel::SummaryHandlingProxyModel ( QObject parent = 0)
explicit

Constructor. Creates a new SummaryHandlingProxyModel with parent parent

Definition at line 122 of file kdganttsummaryhandlingproxymodel.cpp.

SummaryHandlingProxyModel::~SummaryHandlingProxyModel ( )
override

Definition at line 129 of file kdganttsummaryhandlingproxymodel.cpp.

Member Function Documentation

int ForwardingProxyModel::columnCount ( const QModelIndex &  idx = QModelIndex()) const
overrideinherited
See also
QAbstractItemModel::columnCount

Definition at line 262 of file kdganttforwardingproxymodel.cpp.

References KDGantt::ForwardingProxyModel::mapToSource().

QVariant SummaryHandlingProxyModel::data ( const QModelIndex &  proxyIndex,
int  role = Qt::DisplayRole 
) const
override
bool ForwardingProxyModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
overrideinherited
Qt::ItemFlags SummaryHandlingProxyModel::flags ( const QModelIndex &  idx) const
override
See also
QAbstractItemModel::flags

Definition at line 216 of file kdganttsummaryhandlingproxymodel.cpp.

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

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

QModelIndex ForwardingProxyModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
overrideinherited
QModelIndex ForwardingProxyModel::mapFromSource ( const QModelIndex &  sourceIndex) const
overrideinherited
QModelIndex ForwardingProxyModel::mapToSource ( const QModelIndex &  proxyIndex) const
overrideinherited
QMimeData * ForwardingProxyModel::mimeData ( const QModelIndexList &  indexes) const
overrideinherited
QStringList ForwardingProxyModel::mimeTypes ( ) const
overrideinherited

Definition at line 314 of file kdganttforwardingproxymodel.cpp.

QModelIndex ForwardingProxyModel::parent ( const QModelIndex &  idx) const
overrideinherited
See also
QAbstractItemModel::parent

Definition at line 274 of file kdganttforwardingproxymodel.cpp.

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

int ForwardingProxyModel::rowCount ( const QModelIndex &  idx = QModelIndex()) const
overrideinherited
See also
QAbstractItemModel::rowCount

Definition at line 256 of file kdganttforwardingproxymodel.cpp.

References KDGantt::ForwardingProxyModel::mapToSource().

Referenced by KDGantt::ForwardingProxyModel::dropMimeData().

bool SummaryHandlingProxyModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override
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 152 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

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 187 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

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 195 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

void ForwardingProxyModel::sourceColumnsInserted ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
protectedvirtualslotinherited

Called after columns have been inserted into the source model.

See also
QAbstractItemModel::columnsInserted()

Definition at line 188 of file kdganttforwardingproxymodel.cpp.

Referenced by KDGantt::ForwardingProxyModel::setSourceModel().

void ForwardingProxyModel::sourceColumnsRemoved ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
protectedvirtualslotinherited

Called after columns have been removed from the source model.

See also
QAbstractItemModel::columnsRemoved()

Definition at line 209 of file kdganttforwardingproxymodel.cpp.

Referenced by KDGantt::ForwardingProxyModel::setSourceModel().

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 170 of file kdganttsummaryhandlingproxymodel.cpp.

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

void ForwardingProxyModel::sourceLayoutAboutToBeChanged ( )
protectedvirtualslotinherited

Called just before the layout of the source model is changed.

See also
QAbstractItemModel::layoutAboutToBeChanged()

Definition at line 150 of file kdganttforwardingproxymodel.cpp.

Referenced by KDGantt::ForwardingProxyModel::setSourceModel().

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 164 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

void ForwardingProxyModel::sourceModelAboutToBeReset ( )
protectedvirtualslotinherited

Called when the source model is about to be reset.

See also
QAbstractItemModel::modelAboutToBeReset()

Definition at line 131 of file kdganttforwardingproxymodel.cpp.

Referenced by KDGantt::ForwardingProxyModel::setSourceModel().

void SummaryHandlingProxyModel::sourceModelReset ( )
overrideprotectedvirtual

Called when the source model is reset

See also
QAbstractItemModel::modelReset()

Reimplemented from KDGantt::ForwardingProxyModel.

Definition at line 158 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

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 203 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

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 209 of file kdganttsummaryhandlingproxymodel.cpp.

References d.

void ForwardingProxyModel::sourceRowsInserted ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
protectedvirtualslotinherited

Called after rows have been inserted into the source model.

See also
QAbstractItemModel::rowsInserted()

Definition at line 228 of file kdganttforwardingproxymodel.cpp.

Referenced by KDGantt::ForwardingProxyModel::setSourceModel().

void ForwardingProxyModel::sourceRowsRemoved ( const QModelIndex &  parentIdx,
int  start,
int  end 
)
protectedvirtualslotinherited

Called after rows have been removed from the source model.

See also
QAbstractItemModel::rowsRemoved()

Definition at line 247 of file kdganttforwardingproxymodel.cpp.

Referenced by KDGantt::ForwardingProxyModel::setSourceModel().

Qt::DropActions ForwardingProxyModel::supportedDropActions ( ) const
overrideinherited

Definition at line 319 of file kdganttforwardingproxymodel.cpp.


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

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
https://www.kdab.com/
https://www.kdab.com/products/kd-chart/