32 #ifndef pqProxySILModel_h 33 #define pqProxySILModel_h 35 #include "pqComponentsModule.h" 37 #include <QAbstractProxyModel> 48 typedef QAbstractProxyModel Superclass;
49 Q_PROPERTY(QList<QVariant> values READ values WRITE setValues)
57 virtual int rowCount(
const QModelIndex &theParent=QModelIndex())
const 64 return this->sourceModel()->rowCount(this->mapToSource(theParent));
72 virtual int columnCount(
const QModelIndex &theParent=QModelIndex())
const 74 return this->sourceModel()->columnCount(this->mapToSource(theParent));
82 virtual bool hasChildren(
const QModelIndex &theParent=QModelIndex())
const 84 return this->sourceModel()->hasChildren(this->mapToSource(theParent));
94 virtual QModelIndex
index(
int row,
int column,
95 const QModelIndex &theParent=QModelIndex())
const 97 QModelIndex sourceIndex =
98 this->sourceModel()->index(row, column, this->mapToSource(theParent));
99 return this->mapFromSource(sourceIndex);
107 virtual QModelIndex
parent(
const QModelIndex &theIndex)
const 109 QModelIndex sourceIndex = this->sourceModel()->parent(this->mapToSource(theIndex));
110 return this->mapFromSource(sourceIndex);
116 bool setData(
const QModelIndex &theIndex,
const QVariant& value,
117 int role = Qt::EditRole)
119 return this->sourceModel()->setData(this->mapToSource(theIndex), value, role);
124 virtual QModelIndex mapFromSource(
const QModelIndex& sourceIndex)
const;
125 virtual QModelIndex mapToSource(
const QModelIndex& proxyIndex)
const;
126 virtual void setSourceModel(QAbstractItemModel *sourceModel);
133 virtual QVariant headerData (
int, Qt::Orientation,
int role = Qt::DisplayRole )
const;
136 virtual QVariant data(
const QModelIndex &proxyIndex,
int role = Qt::DisplayRole)
const;
140 virtual Qt::ItemFlags flags(
const QModelIndex &index)
const;
143 QList<QVariant> values()
const;
146 void setNoCheckBoxes(
bool val);
149 void setHeaderTitle(QString &title);
153 void setValues(
const QList<QVariant>&);
157 void toggleRootCheckState();
160 void valuesChanged();
165 QModelIndex pidx1 = this->mapFromSource(idx1);
166 QModelIndex pidx2 = this->mapFromSource(idx2);
167 if (!pidx1.isValid() || !pidx2.isValid())
170 emit this->headerDataChanged(Qt::Horizontal, 0, 0);
172 emit this->dataChanged(pidx1, pidx2);
175 void onCheckStatusChanged();
180 pqTimer DelayedValuesChangedSignalTimer;
181 QPixmap CheckboxPixmaps[3];
182 QString HierarchyName;
bool setData(const QModelIndex &theIndex, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual bool hasChildren(const QModelIndex &theParent=QModelIndex()) const
Gets whether or not the given index has child items.
pqProxySILModel is a proxy model for pqSILModel.
virtual QModelIndex parent(const QModelIndex &theIndex) const
Gets the parent for a given index.
void sourceDataChanged(const QModelIndex &idx1, const QModelIndex &idx2)
virtual QModelIndex index(int row, int column, const QModelIndex &theParent=QModelIndex()) const
Gets a model index for a given location.
virtual int columnCount(const QModelIndex &theParent=QModelIndex()) const
Gets the number of columns for a given index.