32 #ifndef pqProxySILModel_h 33 #define pqProxySILModel_h 35 #include "pqComponentsModule.h" 37 #include <QAbstractProxyModel> 50 typedef QAbstractProxyModel Superclass;
51 Q_PROPERTY(QList<QVariant> values READ values WRITE setValues)
68 virtual int rowCount(
const QModelIndex& theParent = QModelIndex())
const 70 return this->sourceModel()->rowCount(this->mapToSource(theParent));
80 virtual int columnCount(
const QModelIndex& theParent = QModelIndex())
const 82 return this->sourceModel()->columnCount(this->mapToSource(theParent));
92 virtual bool hasChildren(
const QModelIndex& theParent = QModelIndex())
const 94 return this->sourceModel()->hasChildren(this->mapToSource(theParent));
106 virtual QModelIndex
index(
int row,
int column,
const QModelIndex& theParent = QModelIndex())
const 108 QModelIndex sourceIndex = this->sourceModel()->index(row, column, this->mapToSource(theParent));
109 return this->mapFromSource(sourceIndex);
119 virtual QModelIndex
parent(
const QModelIndex& theIndex)
const 121 QModelIndex sourceIndex = this->sourceModel()->parent(this->mapToSource(theIndex));
122 return this->mapFromSource(sourceIndex);
130 bool setData(
const QModelIndex& theIndex,
const QVariant& value,
int role = Qt::EditRole)
132 return this->sourceModel()->setData(this->mapToSource(theIndex), value, role);
139 virtual QModelIndex mapFromSource(
const QModelIndex& sourceIndex)
const;
140 virtual QModelIndex mapToSource(
const QModelIndex& proxyIndex)
const;
141 virtual void setSourceModel(QAbstractItemModel* sourceModel);
150 virtual QVariant headerData(
int, Qt::Orientation,
int role = Qt::DisplayRole)
const;
155 virtual QVariant data(
const QModelIndex& proxyIndex,
int role = Qt::DisplayRole)
const;
161 virtual Qt::ItemFlags flags(
const QModelIndex& index)
const;
166 QList<QVariant> values()
const;
171 void setNoCheckBoxes(
bool val);
176 void setHeaderTitle(QString& title);
182 void setValues(
const QList<QVariant>&);
188 void toggleRootCheckState();
191 void valuesChanged();
196 QModelIndex pidx1 = this->mapFromSource(idx1);
197 QModelIndex pidx2 = this->mapFromSource(idx2);
198 if (!pidx1.isValid() || !pidx2.isValid())
201 emit this->headerDataChanged(Qt::Horizontal, 0, 0);
203 emit this->dataChanged(pidx1, pidx2);
206 void onCheckStatusChanged();
211 pqTimer DelayedValuesChangedSignalTimer;
212 QPixmap CheckboxPixmaps[3];
213 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.
virtual int rowCount(const QModelIndex &theParent=QModelIndex()) const
Gets the number of rows for a given index.
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.