ImFusion SDK 4.3
DataGroupingModel Class Referencefinal

#include <ImFusion/GUI/DataGroupingModel.h>

QAbstractProxyModel implementation that groups data in a source-model according to a specified GroupingOption. More...

+ Inheritance diagram for DataGroupingModel:

Detailed Description

QAbstractProxyModel implementation that groups data in a source-model according to a specified GroupingOption.

Note
This model is reset every time new data is added/moved/removed from the Data Model and if the GroupingOption is changed. This model should not be used without a source-model. Data can be grouped by Study-ID (GroupingOption::StudyId), Patient-ID (GroupingOption::PatientId), or not grouped (GroupingOption::None)

Public Types

enum class  GroupingOption { StudyId = 0 , PatientId = 1 , None = 2 }
 Specific grouping options to gather the corresponding info from the ImageInfoDataComponent.
 

Public Member Functions

 DataGroupingModel (GroupingOption opt, QAbstractItemModel *sourceModel=nullptr, QObject *parent=nullptr)
 Ctor: pass the option for grouping the data and the source model. If you prefer you can also set the source model via setSourceModel.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 QAbstractItemModel interface implementation.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
QModelIndex buddy (const QModelIndex &index) const override
 
QModelIndex index (const Data *, int column) const
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QModelIndex mapFromSource (const QModelIndex &sourceIndex) const override
 QAbstractProxyModel interface implementation.
 
QModelIndex mapToSource (const QModelIndex &proxyIndex) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setSourceModel (QAbstractItemModel *sourceModel) override
 sets the source model and resets this model
 
void setGroupingOption (GroupingOption opt)
 sets the GroupingOption and resets this model
 
GroupingOption groupingOption () const
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Public Attributes

Signal< QModelIndex > signalGroupAdded
 Signals that a group was added - connect to this e.g. to expand items in the DataWidget.
 

Additional Inherited Members

- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close