v2.0.0
Loading...
Searching...
No Matches
DISPLIB::BidsViewModel Class Reference

QStandardItemModel mirroring the BIDS dataset hierarchy (subjects / sessions / runs / derivatives). More...

#include <bidsviewmodel.h>

Public Types

typedef QSharedPointer< BidsViewModelSPtr
typedef QSharedPointer< const BidsViewModelConstSPtr

Public Slots

void addData (QModelIndex selectedItem, QStandardItem *pNewItem, int iDataType)
void addToData (QStandardItem *pNewItem, const QModelIndex &parentIndex, int iDataType)
QModelIndex addSubject (const QString &sSubjectName)
QModelIndex addSessionToSubject (const QString &sSubjectName, const QString &sSessionName)
QModelIndex addSessionToSubject (QModelIndex subjectIndex, const QString &sSessionName)
QModelIndex addDataToSession (QModelIndex sessionIndex, QStandardItem *pNewItem, int iDataType)
QModelIndex moveSessionToSubject (QModelIndex subjectIndex, QModelIndex sessionIndex)
QModelIndex moveDataToSession (QModelIndex sessionIndex, QModelIndex dataIndex)
bool removeItem (QModelIndex itemIndex)

Signals

void newItemIndex (QModelIndex itemIndex)

Public Member Functions

 BidsViewModel (QObject *pParent=nullptr)
 ~BidsViewModel ()

Detailed Description

QStandardItemModel mirroring the BIDS dataset hierarchy (subjects / sessions / runs / derivatives).

Rebuilds itself from a top-level dataset path; item roles carry the absolute path, BIDS entity type and loadable-by-this-app flag so the host BidsView can dispatch double-clicks without re-walking the file system.

Definition at line 95 of file bidsviewmodel.h.

Inheritance diagram for DISPLIB::BidsViewModel:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const BidsViewModel> DISPLIB::BidsViewModel::ConstSPtr

Const shared pointer type for BidsViewModel.

Definition at line 101 of file bidsviewmodel.h.

◆ SPtr

Shared pointer type for BidsViewModel.

Definition at line 100 of file bidsviewmodel.h.

Constructor & Destructor Documentation

◆ BidsViewModel()

BidsViewModel::BidsViewModel ( QObject * pParent = nullptr)

Constructs the Analyze Data Model.

Definition at line 37 of file bidsviewmodel.cpp.

◆ ~BidsViewModel()

BidsViewModel::~BidsViewModel ( )

Destroys the Analyze Data Model.

Definition at line 45 of file bidsviewmodel.cpp.

Member Function Documentation

◆ addData

void BidsViewModel::addData ( QModelIndex selectedItem,
QStandardItem * pNewItem,
int iDataType )
slot

Adds data to the item model.

Parameters
[in]sSubjectNameThe subject name to store the data under.
[in]pItemThe item to be added.

Definition at line 51 of file bidsviewmodel.cpp.

◆ addDataToSession

QModelIndex BidsViewModel::addDataToSession ( QModelIndex sessionIndex,
QStandardItem * pNewItem,
int iDataType )
slot

Adds data item pNewItem to session at sessionIndex

Parameters
[in]sessionIndexIndex of session to which data will be added.
[in]pNewItemNew item to be added.
Returns
index of newly added item.

Definition at line 221 of file bidsviewmodel.cpp.

◆ addSessionToSubject [1/2]

QModelIndex BidsViewModel::addSessionToSubject ( const QString & sSubjectName,
const QString & sSessionName )
slot

Adds session named after sSessionName to subjects names sSubjectName

Parameters
[in]sSubjectNameName of subject to which session will be added.
[in]sSessionNameName of session to add.
Returns
index of newly added item.

Definition at line 139 of file bidsviewmodel.cpp.

◆ addSessionToSubject [2/2]

QModelIndex BidsViewModel::addSessionToSubject ( QModelIndex subjectIndex,
const QString & sSessionName )
slot

Adds session named after sSessionName to subject at subjectIndex

Parameters
[in]subjectIndexIndex of subject to which session will be added.
[in]sSessionNameName of session to add.
Returns
index of newly added item.

Definition at line 191 of file bidsviewmodel.cpp.

◆ addSubject

QModelIndex BidsViewModel::addSubject ( const QString & sSubjectName)
slot

Adds subject with given input name

Parameters
[in]sSubjectNamename of subject name.
Returns
index of newly added item.

Definition at line 112 of file bidsviewmodel.cpp.

◆ addToData

void BidsViewModel::addToData ( QStandardItem * pNewItem,
const QModelIndex & parentIndex,
int iDataType )
slot

Adds a sub-item to a data item (ex. an average)

Parameters
[in]pNewItemitem to be added.
[in]parentIndexindex of where the nitem should be added.

Definition at line 95 of file bidsviewmodel.cpp.

◆ moveDataToSession

QModelIndex BidsViewModel::moveDataToSession ( QModelIndex sessionIndex,
QModelIndex dataIndex )
slot

Moves data at dataIndex to session at sessionIndex

Parameters
[in]sessionIndexTarget session.
[in]dataIndexData to be moved.
Returns

Definition at line 306 of file bidsviewmodel.cpp.

◆ moveSessionToSubject

QModelIndex BidsViewModel::moveSessionToSubject ( QModelIndex subjectIndex,
QModelIndex sessionIndex )
slot

Moves a session to a new subject

Parameters
[in]subjectIndexTarget subject.
[in]sessionIndexSession to be moved.
Returns

Definition at line 277 of file bidsviewmodel.cpp.

◆ newItemIndex

void DISPLIB::BidsViewModel::newItemIndex ( QModelIndex itemIndex)
signal

Emit index of newly added items to be selected

Parameters
[in]itemIndexindex of new item.

◆ removeItem

bool BidsViewModel::removeItem ( QModelIndex itemIndex)
slot

Removes item at index itemIndex

Parameters
[in]itemIndexindex of item to be removed.
Returns
true if succefully removed, false if not.

Definition at line 349 of file bidsviewmodel.cpp.


The documentation for this class was generated from the following files: