#include <ModelDataTableModel.h>

Inheritance diagram for ModelDataTableModel:
Inheritance graph
Collaboration diagram for ModelDataTableModel:
Collaboration graph

Signals

void frameSelected (int)
 
void addCommand (Command *)
 
void currentChanged (const QModelIndex &)
 
void modelRemoved ()
 

Public Member Functions

 ModelDataTableModel (ModelId modelId)
 
virtual ~ModelDataTableModel ()
 
QVariant data (const QModelIndex &index, int role) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
bool insertRow (int row, const QModelIndex &parent=QModelIndex())
 
bool removeRow (int row, const QModelIndex &parent=QModelIndex())
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, 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
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex getModelIndexForFrame (sv_frame_t frame) const
 
sv_frame_t getFrameForModelIndex (const QModelIndex &) const
 
void sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override
 
QModelIndex findText (QString text) const
 
void setCurrentRow (int row)
 
int getCurrentRow () const
 

Protected Types

typedef std::vector< int > RowList
 

Protected Slots

void modelChanged (ModelId)
 
void modelChangedWithin (ModelId, sv_frame_t, sv_frame_t)
 

Protected Member Functions

std::shared_ptr< TabularModelgetTabularModel () const
 
int getSorted (int row) const
 
int getUnsorted (int row) const
 
void resort () const
 
void resortNumeric () const
 
void resortAlphabetical () const
 
void clearSort ()
 

Protected Attributes

ModelId m_model
 
int m_sortColumn
 
Qt::SortOrder m_sortOrdering
 
int m_currentRow
 
RowList m_sort
 
RowList m_rsort
 

Detailed Description

Definition at line 31 of file ModelDataTableModel.h.

Member Typedef Documentation

typedef std::vector<int> ModelDataTableModel::RowList
protected

Definition at line 88 of file ModelDataTableModel.h.

Constructor & Destructor Documentation

ModelDataTableModel::ModelDataTableModel ( ModelId  modelId)
ModelDataTableModel::~ModelDataTableModel ( )
virtual

Definition at line 40 of file ModelDataTableModel.cpp.

Member Function Documentation

QVariant ModelDataTableModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 45 of file ModelDataTableModel.cpp.

References getTabularModel(), and getUnsorted().

bool ModelDataTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

Definition at line 56 of file ModelDataTableModel.cpp.

References addCommand(), getTabularModel(), and getUnsorted().

bool ModelDataTableModel::insertRow ( int  row,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 73 of file ModelDataTableModel.cpp.

References addCommand(), getTabularModel(), and getUnsorted().

bool ModelDataTableModel::removeRow ( int  row,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 89 of file ModelDataTableModel.cpp.

References addCommand(), getTabularModel(), and getUnsorted().

Qt::ItemFlags ModelDataTableModel::flags ( const QModelIndex &  index) const
override

Definition at line 105 of file ModelDataTableModel.cpp.

QVariant ModelDataTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 113 of file ModelDataTableModel.cpp.

References getTabularModel().

QModelIndex ModelDataTableModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 128 of file ModelDataTableModel.cpp.

QModelIndex ModelDataTableModel::parent ( const QModelIndex &  index) const
override

Definition at line 134 of file ModelDataTableModel.cpp.

int ModelDataTableModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override
int ModelDataTableModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 150 of file ModelDataTableModel.cpp.

References getTabularModel().

Referenced by findText(), and modelChanged().

QModelIndex ModelDataTableModel::getModelIndexForFrame ( sv_frame_t  frame) const

Definition at line 159 of file ModelDataTableModel.cpp.

References getSorted(), and getTabularModel().

Referenced by modelChangedWithin().

sv_frame_t ModelDataTableModel::getFrameForModelIndex ( const QModelIndex &  index) const

Definition at line 168 of file ModelDataTableModel.cpp.

References getTabularModel(), and getUnsorted().

void ModelDataTableModel::sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)
override
QModelIndex ModelDataTableModel::findText ( QString  text) const
void ModelDataTableModel::setCurrentRow ( int  row)

Definition at line 405 of file ModelDataTableModel.cpp.

References getUnsorted(), and m_currentRow.

int ModelDataTableModel::getCurrentRow ( ) const

Definition at line 399 of file ModelDataTableModel.cpp.

References getSorted(), and m_currentRow.

Referenced by findText(), and sort().

void ModelDataTableModel::frameSelected ( int  )
signal
void ModelDataTableModel::addCommand ( Command )
signal

Referenced by insertRow(), removeRow(), and setData().

void ModelDataTableModel::currentChanged ( const QModelIndex &  )
signal

Referenced by sort().

void ModelDataTableModel::modelRemoved ( )
signal
void ModelDataTableModel::modelChanged ( ModelId  )
protectedslot

Definition at line 220 of file ModelDataTableModel.cpp.

References clearSort(), columnCount(), rowCount(), and SVDEBUG.

Referenced by ModelDataTableModel().

void ModelDataTableModel::modelChangedWithin ( ModelId  ,
sv_frame_t  f0,
sv_frame_t  f1 
)
protectedslot

Definition at line 238 of file ModelDataTableModel.cpp.

References clearSort(), getModelIndexForFrame(), rowCount(), and SVDEBUG.

Referenced by ModelDataTableModel().

std::shared_ptr<TabularModel> ModelDataTableModel::getTabularModel ( ) const
inlineprotected
int ModelDataTableModel::getSorted ( int  row) const
protected
int ModelDataTableModel::getUnsorted ( int  row) const
protected
void ModelDataTableModel::resort ( ) const
protected
void ModelDataTableModel::resortNumeric ( ) const
protected

Definition at line 350 of file ModelDataTableModel.cpp.

References getTabularModel(), m_rsort, m_sortColumn, and TabularModel::SortRole.

Referenced by resort().

void ModelDataTableModel::resortAlphabetical ( ) const
protected

Definition at line 374 of file ModelDataTableModel.cpp.

References getTabularModel(), m_rsort, m_sortColumn, and TabularModel::SortRole.

Referenced by resort().

void ModelDataTableModel::clearSort ( )
protected

Definition at line 411 of file ModelDataTableModel.cpp.

References m_sort.

Referenced by modelChanged(), modelChangedWithin(), and sort().

Member Data Documentation

ModelId ModelDataTableModel::m_model
protected

Definition at line 84 of file ModelDataTableModel.h.

Referenced by getTabularModel().

int ModelDataTableModel::m_sortColumn
protected
Qt::SortOrder ModelDataTableModel::m_sortOrdering
protected

Definition at line 86 of file ModelDataTableModel.h.

Referenced by getSorted(), getUnsorted(), and sort().

int ModelDataTableModel::m_currentRow
protected

Definition at line 87 of file ModelDataTableModel.h.

Referenced by getCurrentRow(), and setCurrentRow().

RowList ModelDataTableModel::m_sort
mutableprotected

Definition at line 89 of file ModelDataTableModel.h.

Referenced by clearSort(), getSorted(), getUnsorted(), and resort().

RowList ModelDataTableModel::m_rsort
mutableprotected

Definition at line 90 of file ModelDataTableModel.h.

Referenced by getUnsorted(), resort(), resortAlphabetical(), and resortNumeric().


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