svcore  1.9
ModelDataTableModel Class Reference

#include <ModelDataTableModel.h>

Collaboration diagram for ModelDataTableModel:

List of all members.

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

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

Definition at line 80 of file ModelDataTableModel.h.


Constructor & Destructor Documentation

Definition at line 40 of file ModelDataTableModel.cpp.


Member Function Documentation

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

Definition at line 45 of file ModelDataTableModel.cpp.

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

bool ModelDataTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
bool ModelDataTableModel::insertRow ( int  row,
const QModelIndex &  parent = QModelIndex() 
)
bool ModelDataTableModel::removeRow ( int  row,
const QModelIndex &  parent = QModelIndex() 
)
Qt::ItemFlags ModelDataTableModel::flags ( const QModelIndex &  index) const

Definition at line 108 of file ModelDataTableModel.cpp.

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.

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

Definition at line 130 of file ModelDataTableModel.cpp.

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

Definition at line 136 of file ModelDataTableModel.cpp.

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

Definition at line 142 of file ModelDataTableModel.cpp.

References TabularModel::getRowCount(), and m_model.

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

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

Definition at line 150 of file ModelDataTableModel.cpp.

References TabularModel::getColumnCount(), and m_model.

Referenced by findText().

QModelIndex ModelDataTableModel::getModelIndexForFrame ( int  frame) const

Definition at line 158 of file ModelDataTableModel.cpp.

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

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

Definition at line 166 of file ModelDataTableModel.cpp.

References TabularModel::getFrameForRow(), getUnsorted(), and m_model.

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

Definition at line 379 of file ModelDataTableModel.cpp.

References getUnsorted(), and m_currentRow.

Definition at line 373 of file ModelDataTableModel.cpp.

References getSorted(), and m_currentRow.

Referenced by findText(), and sort().

void ModelDataTableModel::frameSelected ( int  ) [signal]

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

void ModelDataTableModel::currentChanged ( const QModelIndex &  ) [signal]

Referenced by sort().

void ModelDataTableModel::modelChanged ( ) [protected, slot]

Definition at line 215 of file ModelDataTableModel.cpp.

References clearSort().

Referenced by ModelDataTableModel().

void ModelDataTableModel::modelChangedWithin ( int  ,
int   
) [protected, slot]

!! inefficient

Definition at line 222 of file ModelDataTableModel.cpp.

References clearSort().

Referenced by ModelDataTableModel().

void ModelDataTableModel::modelAboutToBeDeleted ( ) [protected, slot]

Definition at line 230 of file ModelDataTableModel.cpp.

References m_model, and modelRemoved().

Referenced by ModelDataTableModel().

void ModelDataTableModel::clearSort ( ) [protected]

Definition at line 385 of file ModelDataTableModel.cpp.

References m_sort.

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


Member Data Documentation

Qt::SortOrder ModelDataTableModel::m_sortOrdering [protected]

Definition at line 78 of file ModelDataTableModel.h.

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

Definition at line 79 of file ModelDataTableModel.h.

Referenced by getCurrentRow(), and setCurrentRow().

RowList ModelDataTableModel::m_sort [mutable, protected]

Definition at line 81 of file ModelDataTableModel.h.

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

RowList ModelDataTableModel::m_rsort [mutable, protected]

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: