13 #ifndef QmitkPropertyItemModel_h
14 #define QmitkPropertyItemModel_h
17 #include <QAbstractItemModel>
26 struct IBerryPreferences;
68 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
76 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
83 Qt::ItemFlags
flags(
const QModelIndex &index)
const override;
98 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
107 QModelIndex
index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const override;
114 QModelIndex
parent(
const QModelIndex &child)
const override;
121 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
130 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
145 void CreateRootItem();
147 void OnPropertyListModified();
148 void OnPropertyListDeleted();
149 void OnPropertyModified(
const itk::Object *property,
const itk::EventObject &event);
156 std::unique_ptr<QmitkPropertyItem> m_RootItem;
157 std::map<std::string, unsigned long> m_PropertyDeletedTags;
158 std::map<std::string, unsigned long> m_PropertyModifiedTags;
159 unsigned long m_PropertyListDeletedTag;
160 unsigned long m_PropertyListModifiedTag;
A tree model that exposes the properties of a mitk::PropertyList.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets the property value at the given index.
QModelIndex parent(const QModelIndex &child) const override
Returns the parent index for the given child index.
void Update()
Forces a complete rebuild of the model from the current property list.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the model index for the given row and column.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags. The value column is editable for leaf items.
void SetPropertyList(mitk::PropertyList *propertyList, const QString &className="")
Sets the property list and optional class name for filtering.
mitk::PropertyList * GetPropertyList() const
Returns the currently associated property list.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns data for the given index and role.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns (always 2: name and value).
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows (child properties) under the given parent.
QmitkPropertyItemModel(QObject *parent=nullptr)
Constructs the property item model.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns header data for the given section.
~QmitkPropertyItemModel() override
A tree item used by QmitkPropertyItemModel to represent a property row.
Abstract base class for properties.
Key-value list holding instances of BaseProperty.
Find image slices visible on a given plane.
@ PropertyRole
Returns a mitk::BaseProperty* wrapped in QVariant.