|
Isis 3 Programmer Reference
|
1 #ifndef ProjectItemProxyModel_h
2 #define ProjectItemProxyModel_h
15 #include "ProjectItem.h"
16 #include "ProjectItemModel.h"
19 template <
typename T>
class QList;
91 virtual bool canDropMimeData(
const QMimeData *data, Qt::DropAction action,
92 int row,
int column,
const QModelIndex &parent)
const;
93 virtual bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
94 int row,
int column,
const QModelIndex &parent);
Provides access to data stored in a Project through Qt's model-view framework.
ProjectItemModel * m_sourceModel
The source model. Map of items from the source model to the proxy model.
QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection)
Returns a QItemSelection of items in the proxy model that corresponds with a QItemSelection of items ...
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Adds the data (selected items) from the source model to the proxy model.
void updateProxyCurrent()
Slot that updates the current item in the proxy model only if it is different than the corresponding ...
void addItems(QList< ProjectItem * > sourceItems)
Adds a list of items to the proxy model.
This is free and unencumbered software released into the public domain.
QModelIndex mapIndexToSource(const QModelIndex &proxyIndex)
Returns the QModelIndex of an item in the souce model that corresponds with the QModelIndex of an ite...
ProjectItem * addChild(ProjectItem *sourceItem, ProjectItem *parentItem)
Creates an item in the proxy model corresponding to an item in the source model as a child of a paren...
void updateSourceCurrent()
Slot that updates the current item in the proxy model only if it is different than the corresponding ...
Allows access to items in a ProjectItemModel through a proxy model.
ProjectItemModel * sourceModel()
Returns the source model.
void onItemChanged(QStandardItem *item)
Signal to connect to the itemChanged() signal from a ProjectItemModel.
ProjectItem * mapItemToSource(ProjectItem *proxyItem)
Returns the ProjectItem in the source model that corresponds with a ProjectItem in the source model.
QItemSelection mapSelectionToSource(const QItemSelection &proxySelection)
Returns a QItemSelection of items in the source model that corresponds with a QItemSelection of itesm...
ProjectItem * item(int row)
Returns the top-level item at the given row.
void removeItem(ProjectItem *item)
Removes an item and its children from the proxy model.
QModelIndex mapIndexFromSource(const QModelIndex &sourceIndex)
Returns the QModelIndex of an item in the proxy model that corresponds with the QModelIndex of an ite...
void updateProxySelection()
Slot that updates the selection in the proxy model only if it is different than the corresponding sel...
ProjectItem * mapItemFromSource(ProjectItem *sourceItem)
Returns the ProjectItem in the proxy model that corresponds with a ProjectItem in the source model.
void setSourceModel(ProjectItemModel *sourceModel)
Sets the source model.
void updateSourceSelection()
Slot that updates the selection in the source model only if it is different than the corresponding se...
ProjectItem * addItem(ProjectItem *sourceItem)
Adds an item and its children to the proxy model.
void updateItem(ProjectItem *sourceItem)
Given an item in the source model, this method changes the data of the corresponding item in the prox...
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
Returns true.
This is free and unencumbered software released into the public domain.
ProjectItemProxyModel(QObject *parent=0)
Constructs the proxy model.
This is free and unencumbered software released into the public domain.
Represents an item of a ProjectItemModel in Qt's model-view framework.