svcore  1.9
ModelDataTableModel Class Reference

#include <ModelDataTableModel.h>

Inheritance diagram for ModelDataTableModel:
Collaboration diagram for ModelDataTableModel:

Signals

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

Public Member Functions

 ModelDataTableModel (TabularModel *m)
 
virtual ~ModelDataTableModel ()
 
QVariant data (const QModelIndex &index, int role) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role)
 
bool insertRow (int row, const QModelIndex &parent=QModelIndex())
 
bool removeRow (int row, const QModelIndex &parent=QModelIndex())
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
QModelIndex parent (const QModelIndex &index) const
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QModelIndex getModelIndexForFrame (int frame) const
 
int getFrameForModelIndex (const QModelIndex &) const
 
void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
 
QModelIndex findText (QString text) const
 
void setCurrentRow (int row)
 
int getCurrentRow () const
 

Protected Types

typedef std::vector< int > RowList
 

Protected Slots

void modelChanged ()
 
void modelChangedWithin (int, int)
 
void modelAboutToBeDeleted ()
 

Protected Member Functions

int getSorted (int row) const
 
int getUnsorted (int row) const
 
void resort () const
 
void resortNumeric () const
 
void resortAlphabetical () const
 
void clearSort ()
 

Protected Attributes

TabularModelm_model
 
int m_sortColumn
 
Qt::SortOrder m_sortOrdering
 
int m_currentRow
 
RowList m_sort
 
RowList m_rsort
 

Detailed Description

Definition at line 26 of file ModelDataTableModel.h.

Member Typedef Documentation

◆ RowList

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

Definition at line 80 of file ModelDataTableModel.h.

Constructor & Destructor Documentation

◆ ModelDataTableModel()

ModelDataTableModel::ModelDataTableModel ( TabularModel m)

◆ ~ModelDataTableModel()

ModelDataTableModel::~ModelDataTableModel ( )
virtual

Definition at line 40 of file ModelDataTableModel.cpp.

Member Function Documentation

◆ data()

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

Definition at line 45 of file ModelDataTableModel.cpp.

References TabularModel::getData(), getUnsorted(), index(), and m_model.

◆ setData()

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

◆ insertRow()

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

◆ removeRow()

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

◆ flags()

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

Definition at line 108 of file ModelDataTableModel.cpp.

◆ headerData()

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

Definition at line 116 of file ModelDataTableModel.cpp.

References TabularModel::getHeading(), and m_model.

◆ index()

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

Definition at line 130 of file ModelDataTableModel.cpp.

Referenced by data(), getFrameForModelIndex(), and setData().

◆ parent()

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

Definition at line 136 of file ModelDataTableModel.cpp.

Referenced by columnCount(), insertRow(), removeRow(), and rowCount().

◆ rowCount()

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

Definition at line 142 of file ModelDataTableModel.cpp.

References TabularModel::getRowCount(), m_model, and parent().

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

◆ columnCount()

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

Definition at line 150 of file ModelDataTableModel.cpp.

References TabularModel::getColumnCount(), m_model, and parent().

Referenced by findText().

◆ getModelIndexForFrame()

QModelIndex ModelDataTableModel::getModelIndexForFrame ( int  frame) const

Definition at line 158 of file ModelDataTableModel.cpp.

References TabularModel::getRowForFrame(), getSorted(), and m_model.

◆ getFrameForModelIndex()

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

◆ sort()

void ModelDataTableModel::sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)

◆ findText()

QModelIndex ModelDataTableModel::findText ( QString  text) const

◆ setCurrentRow()

void ModelDataTableModel::setCurrentRow ( int  row)

Definition at line 379 of file ModelDataTableModel.cpp.

References getUnsorted(), and m_currentRow.

◆ getCurrentRow()

int ModelDataTableModel::getCurrentRow ( ) const

Definition at line 373 of file ModelDataTableModel.cpp.

References getSorted(), and m_currentRow.

Referenced by findText(), and sort().

◆ frameSelected

void ModelDataTableModel::frameSelected ( int  )
signal

◆ addCommand

void ModelDataTableModel::addCommand ( Command )
signal

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

◆ currentChanged

void ModelDataTableModel::currentChanged ( const QModelIndex &  )
signal

Referenced by sort().

◆ modelRemoved

void ModelDataTableModel::modelRemoved ( )
signal

Referenced by modelAboutToBeDeleted().

◆ modelChanged

void ModelDataTableModel::modelChanged ( )
protectedslot

Definition at line 215 of file ModelDataTableModel.cpp.

References clearSort().

Referenced by ModelDataTableModel().

◆ modelChangedWithin

void ModelDataTableModel::modelChangedWithin ( int  ,
int   
)
protectedslot

!! inefficient

Definition at line 222 of file ModelDataTableModel.cpp.

References clearSort().

Referenced by ModelDataTableModel().

◆ modelAboutToBeDeleted

void ModelDataTableModel::modelAboutToBeDeleted ( )
protectedslot

Definition at line 230 of file ModelDataTableModel.cpp.

References m_model, and modelRemoved().

Referenced by ModelDataTableModel().

◆ getSorted()

int ModelDataTableModel::getSorted ( int  row) const
protected

◆ getUnsorted()

int ModelDataTableModel::getUnsorted ( int  row) const
protected

◆ resort()

void ModelDataTableModel::resort ( ) const
protected

◆ resortNumeric()

void ModelDataTableModel::resortNumeric ( ) const
protected

◆ resortAlphabetical()

void ModelDataTableModel::resortAlphabetical ( ) const
protected

◆ clearSort()

void ModelDataTableModel::clearSort ( )
protected

Definition at line 385 of file ModelDataTableModel.cpp.

References m_sort.

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

Member Data Documentation

◆ m_model

◆ m_sortColumn

int ModelDataTableModel::m_sortColumn
protected

◆ m_sortOrdering

Qt::SortOrder ModelDataTableModel::m_sortOrdering
protected

Definition at line 78 of file ModelDataTableModel.h.

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

◆ m_currentRow

int ModelDataTableModel::m_currentRow
protected

Definition at line 79 of file ModelDataTableModel.h.

Referenced by getCurrentRow(), and setCurrentRow().

◆ m_sort

RowList ModelDataTableModel::m_sort
mutableprotected

Definition at line 81 of file ModelDataTableModel.h.

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

◆ m_rsort

RowList ModelDataTableModel::m_rsort
mutableprotected

Definition at line 82 of file ModelDataTableModel.h.

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


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