Medical Imaging Interaction Toolkit
2024.06.00
Medical Imaging Interaction Toolkit
|
A table model for showing and editing mitk::Properties. More...
#include <QmitkPropertiesTableModel.h>
Classes | |
struct | PropertyDataSetCompareFunction |
A struct that you can use in std::sort algorithm for sorting the property list elements. More... | |
struct | PropertyListElementFilterFunction |
Public Types | |
typedef std::pair< std::string, mitk::BaseProperty::Pointer > | PropertyDataSet |
Public Member Functions | |
QmitkPropertiesTableModel (QObject *parent=nullptr, mitk::PropertyList::Pointer _PropertyList=nullptr) | |
~QmitkPropertiesTableModel () override | |
Standard dtor. Nothing to do here. More... | |
mitk::PropertyList::Pointer | GetPropertyList () const |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...) More... | |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...) More... | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...) More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...) More... | |
int | columnCount (const QModelIndex &parent) const override |
void | SetPropertyList (mitk::PropertyList *_PropertyList) |
virtual void | PropertyListDelete () |
Gets called when the list is about to be deleted. More... | |
virtual void | PropertyModified (const itk::Object *caller, const itk::EventObject &event) |
Called when a single property was changed. Send a model changed event to the Qt-outer world. More... | |
virtual void | PropertyDelete (const itk::Object *caller, const itk::EventObject &event) |
Called when a single property was changed. Send a model changed event to the Qt-outer world. More... | |
virtual void | SetFilterPropertiesKeyWord (std::string _FilterKeyWord) |
Set a keyword for filtering of properties. Only properties beginning with this string will be shown. More... | |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override |
Reimplemented sort function from QAbstractTableModel to enable sorting on the table. More... | |
Static Public Attributes | |
static const int | PROPERTY_NAME_COLUMN |
static const int | PROPERTY_VALUE_COLUMN |
Protected Member Functions | |
int | FindProperty (const mitk::BaseProperty *_Property) const |
Searches for the specified property and returns the row of the element in this QTableModel. If any errors occur, the function returns -1. More... | |
void | AddSelectedProperty (PropertyDataSet &_PropertyDataSet) |
void | RemoveSelectedProperty (unsigned int _Index) |
void | Reset () |
Protected Attributes | |
mitk::WeakPointer< mitk::PropertyList > | m_PropertyList |
std::vector< PropertyDataSet > | m_SelectedProperties |
Store the properties in a vector so that they may be sorted. More... | |
std::vector< unsigned long > | m_PropertyModifiedObserverTags |
Holds all tags of Modified Event Listeners. We need it to remove them again. More... | |
std::vector< unsigned long > | m_PropertyDeleteObserverTags |
Holds all tags of Modified Event Listeners. We need it to remove them again. More... | |
unsigned long | m_PropertyListDeleteObserverTag |
bool | m_BlockEvents |
Indicates if this class should neglect all incoming events because the class itself triggered the event (e.g. when a property was edited). More... | |
bool | m_SortDescending |
The property is true when the property list is sorted in descending order. More... | |
std::string | m_FilterKeyWord |
If set to any value, only properties containing the specified keyword in their name will be shown. More... | |
A table model for showing and editing mitk::Properties.
Definition at line 31 of file QmitkPropertiesTableModel.h.
typedef std::pair<std::string, mitk::BaseProperty::Pointer> QmitkPropertiesTableModel::PropertyDataSet |
Typedef for the complete Property Datastructure, which may be written as follows: Name->(mitk::BaseProperty::Pointer)
Definition at line 40 of file QmitkPropertiesTableModel.h.
QmitkPropertiesTableModel::QmitkPropertiesTableModel | ( | QObject * | parent = nullptr , |
mitk::PropertyList::Pointer | _PropertyList = nullptr |
||
) |
Constructs a new QmitkDataStorageTableModel and sets the DataNode for this TableModel.
|
override |
Standard dtor. Nothing to do here.
|
protected |
Adds a property dataset to the current selection. When a property is added a modified and delete listener is appended.
|
override |
Overwritten from QAbstractTableModel. Returns the number of columns. That is usually two in this model: the properties name and its value.
|
override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
|
protected |
Searches for the specified property and returns the row of the element in this QTableModel. If any errors occur, the function returns -1.
|
override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
mitk::PropertyList::Pointer QmitkPropertiesTableModel::GetPropertyList | ( | ) | const |
Returns the property list of this table model.
|
override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
|
virtual |
Called when a single property was changed. Send a model changed event to the Qt-outer world.
|
virtual |
Gets called when the list is about to be deleted.
|
virtual |
Called when a single property was changed. Send a model changed event to the Qt-outer world.
|
protected |
Removes a property dataset from the current selection. When a property is removed the modified and delete listener are also removed.
|
protected |
Reset is called when a new filter keyword is set or a new PropertyList is set. First of all, all priorly selected properties are removed. Then all properties to be selected (specified by the keyword) are added to the selection.
|
override |
Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
|
override |
Overridden from QAbstractTableModel. Sets data at index for given role.
|
virtual |
Set a keyword for filtering of properties. Only properties beginning with this string will be shown.
void QmitkPropertiesTableModel::SetPropertyList | ( | mitk::PropertyList * | _PropertyList | ) |
Sets the Property List to show. Resets the whole model. If _PropertyList is nullptr the model is empty.
|
override |
Reimplemented sort function from QAbstractTableModel to enable sorting on the table.
|
protected |
Indicates if this class should neglect all incoming events because the class itself triggered the event (e.g. when a property was edited).
Definition at line 220 of file QmitkPropertiesTableModel.h.
|
protected |
If set to any value, only properties containing the specified keyword in their name will be shown.
Definition at line 230 of file QmitkPropertiesTableModel.h.
|
protected |
Holds all tags of Modified Event Listeners. We need it to remove them again.
Definition at line 212 of file QmitkPropertiesTableModel.h.
|
protected |
Holds the pointer to the properties list. Dont use smart pointers here. Instead: Listen to the delete event.
Definition at line 198 of file QmitkPropertiesTableModel.h.
|
protected |
Definition at line 214 of file QmitkPropertiesTableModel.h.
|
protected |
Holds all tags of Modified Event Listeners. We need it to remove them again.
Definition at line 207 of file QmitkPropertiesTableModel.h.
|
protected |
Store the properties in a vector so that they may be sorted.
Definition at line 202 of file QmitkPropertiesTableModel.h.
|
protected |
The property is true when the property list is sorted in descending order.
Definition at line 225 of file QmitkPropertiesTableModel.h.
|
static |
Definition at line 34 of file QmitkPropertiesTableModel.h.
|
static |
Definition at line 35 of file QmitkPropertiesTableModel.h.