Proxy model that supports summary gantt items. More...
#include <kdganttsummaryhandlingproxymodel.h>
Public Member Functions | |
int | columnCount (const QModelIndex &idx=QModelIndex()) const |
QVariant | data (const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
Qt::ItemFlags | flags (const QModelIndex &idx) const |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
QModelIndex | mapFromSource (const QModelIndex &sourceIndex) const |
QModelIndex | mapToSource (const QModelIndex &proxyIndex) const |
QMimeData * | mimeData (const QModelIndexList &indexes) const |
QStringList | mimeTypes () const |
QModelIndex | parent (const QModelIndex &idx) const |
int | rowCount (const QModelIndex &idx=QModelIndex()) const |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
void | setSourceModel (QAbstractItemModel *model) |
SummaryHandlingProxyModel (QObject *parent=0) | |
Qt::DropActions | supportedDropActions () const |
virtual | ~SummaryHandlingProxyModel () |
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) |
void | sourceColumnsAboutToBeRemoved (const QModelIndex &idx, int start, int end) |
void | sourceDataChanged (const QModelIndex &from, const QModelIndex &to) |
void | sourceLayoutChanged () |
void | sourceModelReset () |
void | sourceRowsAboutToBeInserted (const QModelIndex &idx, int start, int end) |
void | sourceRowsAboutToBeRemoved (const QModelIndex &, int start, int end) |
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.
Definition at line 29 of file kdganttsummaryhandlingproxymodel.h.
SummaryHandlingProxyModel::SummaryHandlingProxyModel | ( | QObject * | parent = 0 |
) | [explicit] |
Constructor. Creates a new SummaryHandlingProxyModel with parent parent
Definition at line 122 of file kdganttsummaryhandlingproxymodel.cpp.
SummaryHandlingProxyModel::~SummaryHandlingProxyModel | ( | ) | [virtual] |
Definition at line 129 of file kdganttsummaryhandlingproxymodel.cpp.
int ForwardingProxyModel::columnCount | ( | const QModelIndex & | idx = QModelIndex() |
) | const [inherited] |
Reimplemented in KDGantt::ProxyModel.
Definition at line 254 of file kdganttforwardingproxymodel.cpp.
References KDGantt::ForwardingProxyModel::mapToSource().
QVariant SummaryHandlingProxyModel::data | ( | const QModelIndex & | proxyIndex, | |
int | role = Qt::DisplayRole | |||
) | const |
Definition at line 227 of file kdganttsummaryhandlingproxymodel.cpp.
References d, KDGantt::EndTimeRole, KDGantt::ForwardingProxyModel::mapToSource(), and KDGantt::StartTimeRole.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
bool ForwardingProxyModel::dropMimeData | ( | const QMimeData * | data, | |
Qt::DropAction | action, | |||
int | row, | |||
int | column, | |||
const QModelIndex & | parent | |||
) | [inherited] |
Definition at line 286 of file kdganttforwardingproxymodel.cpp.
References KDGantt::ForwardingProxyModel::index(), KDGantt::ForwardingProxyModel::mapToSource(), and KDGantt::ForwardingProxyModel::rowCount().
Qt::ItemFlags SummaryHandlingProxyModel::flags | ( | const QModelIndex & | idx | ) | const |
Definition at line 215 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 [inherited] |
Definition at line 260 of file kdganttforwardingproxymodel.cpp.
References KDGantt::ForwardingProxyModel::mapFromSource(), and KDGantt::ForwardingProxyModel::mapToSource().
Referenced by KDGantt::ProxyModel::data(), KDGantt::ForwardingProxyModel::dropMimeData(), and KDAB_SCOPED_UNITTEST_SIMPLE().
QModelIndex ForwardingProxyModel::mapFromSource | ( | const QModelIndex & | sourceIndex | ) | const [inherited] |
Converts indexes in the source model to indexes in the proxy model
Reimplemented in KDGantt::ProxyModel.
Definition at line 45 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::View::ensureVisible(), KDGantt::ForwardingProxyModel::index(), KDGantt::ForwardingProxyModel::parent(), setData(), KDGantt::ForwardingProxyModel::sourceColumnsAboutToBeInserted(), KDGantt::ForwardingProxyModel::sourceColumnsAboutToBeRemoved(), sourceDataChanged(), KDGantt::ForwardingProxyModel::sourceDataChanged(), KDGantt::ForwardingProxyModel::sourceRowsAboutToBeInserted(), and KDGantt::ForwardingProxyModel::sourceRowsAboutToBeRemoved().
QModelIndex ForwardingProxyModel::mapToSource | ( | const QModelIndex & | proxyIndex | ) | const [inherited] |
Converts indexes in the proxy model to indexes in the source model
Reimplemented in KDGantt::ProxyModel.
Definition at line 66 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::columnCount(), data(), KDGantt::ForwardingProxyModel::dropMimeData(), flags(), KDGantt::ForwardingProxyModel::index(), KDGantt::ForwardingProxyModel::mimeData(), KDGantt::ForwardingProxyModel::parent(), KDGantt::ForwardingProxyModel::rowCount(), setData(), and KDGantt::ForwardingProxyModel::setData().
QMimeData * ForwardingProxyModel::mimeData | ( | const QModelIndexList & | indexes | ) | const [inherited] |
Definition at line 278 of file kdganttforwardingproxymodel.cpp.
References KDGantt::ForwardingProxyModel::mapToSource().
QStringList ForwardingProxyModel::mimeTypes | ( | ) | const [inherited] |
Definition at line 306 of file kdganttforwardingproxymodel.cpp.
QModelIndex ForwardingProxyModel::parent | ( | const QModelIndex & | idx | ) | const [inherited] |
Definition at line 266 of file kdganttforwardingproxymodel.cpp.
References KDGantt::ForwardingProxyModel::mapFromSource(), and KDGantt::ForwardingProxyModel::mapToSource().
int ForwardingProxyModel::rowCount | ( | const QModelIndex & | idx = QModelIndex() |
) | const [inherited] |
Reimplemented in KDGantt::ProxyModel.
Definition at line 248 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 | |||
) |
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 251 of file kdganttsummaryhandlingproxymodel.cpp.
References d, KDGantt::EndTimeRole, KDGantt::ForwardingProxyModel::mapFromSource(), KDGantt::ForwardingProxyModel::mapToSource(), and KDGantt::StartTimeRole.
void SummaryHandlingProxyModel::setSourceModel | ( | QAbstractItemModel * | model | ) |
Sets the model to be used as the source model for this proxy. The proxy does not take ownership of the model.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 151 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
void SummaryHandlingProxyModel::sourceColumnsAboutToBeInserted | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual] |
Called just before columns are inserted into the source model.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 186 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
void SummaryHandlingProxyModel::sourceColumnsAboutToBeRemoved | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual] |
Called just before columns are removed from the source model.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 194 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
void ForwardingProxyModel::sourceColumnsInserted | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual, slot, inherited] |
Called after columns have been inserted into the source model.
Definition at line 180 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::setSourceModel().
void ForwardingProxyModel::sourceColumnsRemoved | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual, slot, inherited] |
Called after columns have been removed from the source model.
Definition at line 201 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::setSourceModel().
void SummaryHandlingProxyModel::sourceDataChanged | ( | const QModelIndex & | from, | |
const QModelIndex & | to | |||
) | [protected, virtual] |
Called when the data in an existing item in the source model changes.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 169 of file kdganttsummaryhandlingproxymodel.cpp.
References d, KDGantt::ItemTypeRole, KDGantt::ForwardingProxyModel::mapFromSource(), and KDGantt::TypeSummary.
void ForwardingProxyModel::sourceLayoutAboutToBeChanged | ( | ) | [protected, virtual, slot, inherited] |
Called just before the layout of the source model is changed.
Definition at line 143 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::setSourceModel().
void SummaryHandlingProxyModel::sourceLayoutChanged | ( | ) | [protected, virtual] |
Called when the layout of the source model has changed.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 163 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
void ForwardingProxyModel::sourceModelAboutToBeReset | ( | ) | [protected, virtual, slot, inherited] |
Called when the source model is about to be reset.
Definition at line 125 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::setSourceModel().
void SummaryHandlingProxyModel::sourceModelReset | ( | ) | [protected, virtual] |
Called when the source model is reset
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 157 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
void SummaryHandlingProxyModel::sourceRowsAboutToBeInserted | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual] |
Called just before rows are inserted into the source model.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 202 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
void SummaryHandlingProxyModel::sourceRowsAboutToBeRemoved | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual] |
Called just before rows are removed from the source model.
Reimplemented from KDGantt::ForwardingProxyModel.
Definition at line 208 of file kdganttsummaryhandlingproxymodel.cpp.
References d.
void ForwardingProxyModel::sourceRowsInserted | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual, slot, inherited] |
Called after rows have been inserted into the source model.
Definition at line 220 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::setSourceModel().
void ForwardingProxyModel::sourceRowsRemoved | ( | const QModelIndex & | parentIdx, | |
int | start, | |||
int | end | |||
) | [protected, virtual, slot, inherited] |
Called after rows have been removed from the source model.
Definition at line 239 of file kdganttforwardingproxymodel.cpp.
Referenced by KDGantt::ForwardingProxyModel::setSourceModel().
Qt::DropActions ForwardingProxyModel::supportedDropActions | ( | ) | const [inherited] |
Definition at line 311 of file kdganttforwardingproxymodel.cpp.