32 #ifndef pqProxySILModel_h 33 #define pqProxySILModel_h 37 #include <QAbstractProxyModel> 50 typedef QAbstractProxyModel Superclass;
51 Q_PROPERTY(QList<QVariant> values READ values WRITE setValues)
68 int rowCount(
const QModelIndex& theParent = QModelIndex())
const override 70 return this->sourceModel()->rowCount(this->mapToSource(theParent));
80 int columnCount(
const QModelIndex& theParent = QModelIndex())
const override 82 return this->sourceModel()->columnCount(this->mapToSource(theParent));
92 bool hasChildren(
const QModelIndex& theParent = QModelIndex())
const override 94 return this->sourceModel()->hasChildren(this->mapToSource(theParent));
107 int row,
int column,
const QModelIndex& theParent = QModelIndex())
const override 109 QModelIndex sourceIndex = this->sourceModel()->index(row, column, this->mapToSource(theParent));
110 return this->mapFromSource(sourceIndex);
120 QModelIndex
parent(
const QModelIndex& theIndex)
const override 122 QModelIndex sourceIndex = this->sourceModel()->parent(this->mapToSource(theIndex));
123 return this->mapFromSource(sourceIndex);
131 bool setData(
const QModelIndex& theIndex,
const QVariant& value,
int role = Qt::EditRole)
override 133 return this->sourceModel()->setData(this->mapToSource(theIndex), value, role);
140 QModelIndex mapFromSource(
const QModelIndex& sourceIndex)
const override;
141 QModelIndex mapToSource(
const QModelIndex& proxyIndex)
const override;
142 void setSourceModel(QAbstractItemModel* sourceModel)
override;
150 QVariant headerData(
int, Qt::Orientation,
int role = Qt::DisplayRole)
const override;
155 bool setHeaderData(
int section, Qt::Orientation
orientation,
const QVariant&
value,
156 int role = Qt::EditRole)
override;
161 QVariant
data(
const QModelIndex& proxyIndex,
int role = Qt::DisplayRole)
const override;
167 Qt::ItemFlags flags(
const QModelIndex&
index)
const override;
172 QList<QVariant> values()
const;
177 void setNoCheckBoxes(
bool val);
182 void setHeaderTitle(QString&
title);
188 void setValues(
const QList<QVariant>&);
191 void valuesChanged();
196 QModelIndex pidx1 = this->mapFromSource(idx1);
197 QModelIndex pidx2 = this->mapFromSource(idx2);
198 if (!pidx1.isValid() || !pidx2.isValid())
201 Q_EMIT this->headerDataChanged(Qt::Horizontal, 0, 0);
203 Q_EMIT this->dataChanged(pidx1, pidx2);
206 void onCheckStatusChanged();
211 pqTimer DelayedValuesChangedSignalTimer;
212 QPixmap CheckboxPixmaps[3];
213 QString HierarchyName;
QModelIndex index(int row, int column, const QModelIndex &theParent=QModelIndex()) const override
Gets a model index for a given location.
#define PQCOMPONENTS_EXPORT
int columnCount(const QModelIndex &theParent=QModelIndex()) const override
Gets the number of columns for a given index.
bool setData(const QModelIndex &theIndex, const QVariant &value, int role=Qt::EditRole) override
Sets the role data for the item at index to value.
pqProxySILModel is a proxy model for pqSILModel.
bool hasChildren(const QModelIndex &theParent=QModelIndex()) const override
Gets whether or not the given index has child items.
QModelIndex parent(const QModelIndex &theIndex) const override
Gets the parent for a given index.
void sourceDataChanged(const QModelIndex &idx1, const QModelIndex &idx2)
int rowCount(const QModelIndex &theParent=QModelIndex()) const override
Gets the number of rows for a given index.