FolderTableModel Class Reference

#include <foldertablemodel.h>

Collaboration diagram for FolderTableModel:

Collaboration graph
[legend]

List of all members.

Signals

void modelChanged (const FolderTableModel *thisModel, const bool changed)

Public Member Functions

 FolderTableModel (cool::IFolderPtr folderPtr, cool::ValidityKey start=cool::ValidityKeyMin, cool::ValidityKey end=cool::ValidityKeyMax, cool::ChannelSelection channels=cool::ChannelSelection(), QString tag="", QObject *parent=0)
 ~FolderTableModel ()
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
QVariant rawData (const QModelIndex &index) const
QVariant headerData (int section, Qt::Orientation orientation=Qt::Horizontal, 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
Qt::ItemFlags flags (const QModelIndex &index) const
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void setData (const QModelIndexList &indexList, const QVariant &value, int role=Qt::EditRole)
bool canSetDisplayAsMask (const QModelIndex &index) const
bool canSetDisplayAsMask (const QModelIndexList &indexList) const
bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
bool removeRows (int row, int count=1, const QModelIndex &parent=QModelIndex())
bool insertRows (int row, int count=1, const QModelIndex &parent=QModelIndex())
QVariant::Type getQVariantType (const std::string &coolType) const
QVariant::Type getQVariantType (const QModelIndex &index) const
QVariant::Type getQVariantType (const QString &field) const
QVariant::Type getQVariantType (int column) const
QString getCoolTypeString (const QModelIndex &index) const
RootFolderTableItemgetRootTableItem () const
void setDefaultCopyRow (int row)
QList< int > filter (FilterFunction0 f, bool inverse, bool allChannels=true, int rowStartPos=-1, int rowEndPos=-1)
QList< int > filter_mres (bool inverse=true)
int filter_mre_singleChannel (int row)
bool filter_mre (int row)
QList< FolderTableItem * > _updateValidityKeys (QList< FolderTableItem * > newTableItems)
bool commit ()
bool isNewRow (int row) const
DisplayAsMask getDisplayAsMask (int column) const
ColumnResponse getColumnResponse (int column) const
bool hasMask (int column) const
void setDisplayAsMask (const QModelIndex &index, DisplayAsMask dMask)
QString getInputMask (const QModelIndex &index) const
QVariant getMaskedData (FolderTableItem *&item, int column) const
QValidator * getValidator (const QModelIndex &index) const
QValidator * getValidator (unsigned int column) const
void sort (int column, Qt::SortOrder order)
int compare (const QModelIndex &index, QString value)
int compareQVariants (QVariant A, QVariant B)
void setFiltered (bool enabled=true)
bool isFiltered () const
QSet< unsigned int > newRowChannelIds (QList< FolderTableItem * > newTableItems=QList< FolderTableItem * >()) const

Private Member Functions

void setupFolderTableModelData (cool::ValidityKey start, cool::ValidityKey end, cool::ChannelSelection channels, QString tag)
QVariant qStringToQVariant (QString value, bool *ok, int column, int base=0)
QVariant applyMaskToQVariant (QString format, QVariant currentValue, int column, bool *ok, int fieldWidth=1, int base=10, const QChar &fillChar=QLatin1Char( ' ')) const

Private Attributes

cool::IFolderPtr coolFolderPtr
const cool::IRecordSpecification & payloadSpec
bool filtered
RootFolderTableItemrootTableItem
int defaultCopyRow
QString newRowColour
QString modifiedColour
QString maskColour
QString filteredColour
QHash< int, DisplayAsMaskdisplayAsMaskHash
QHash< int, ColumnResponsecolumnResponseHash


Detailed Description

Definition at line 27 of file foldertablemodel.h.


Constructor & Destructor Documentation

FolderTableModel::FolderTableModel ( cool::IFolderPtr  folderPtr,
cool::ValidityKey  start = cool::ValidityKeyMin,
cool::ValidityKey  end = cool::ValidityKeyMax,
cool::ChannelSelection  channels = cool::ChannelSelection(),
QString  tag = "",
QObject *  parent = 0 
)

FolderTableModel::~FolderTableModel (  ) 

Definition at line 56 of file foldertablemodel.cpp.

References rootTableItem.


Member Function Documentation

QVariant FolderTableModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

QVariant FolderTableModel::rawData ( const QModelIndex &  index  )  const

Definition at line 853 of file foldertablemodel.cpp.

References FolderTableItem::data().

Referenced by compare(), FilterEntry::filter_nonDate(), and FolderTableDelegate::setEditorData().

Here is the call graph for this function:

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

Definition at line 90 of file foldertablemodel.cpp.

References RootFolderTableItem::header(), and rootTableItem.

Referenced by FilterBuilder::fillColumn().

Here is the call graph for this function:

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

Definition at line 98 of file foldertablemodel.cpp.

References RootFolderTableItem::child(), and rootTableItem.

Referenced by _updateValidityKeys(), FilterBuilder::applyFilter(), canSetDisplayAsMask(), and setData().

Here is the call graph for this function:

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

Definition at line 118 of file foldertablemodel.cpp.

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

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

Definition at line 82 of file foldertablemodel.cpp.

References RootFolderTableItem::columnCount(), and rootTableItem.

Referenced by FilterBuilder::fillColumn(), getQVariantType(), and setDisplayAsMask().

Here is the call graph for this function:

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

Definition at line 61 of file foldertablemodel.cpp.

References columnResponseHash, noResponse, and readonlyResponse.

Referenced by FolderTableView::contextMenuEvent(), and setData().

bool FolderTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

void FolderTableModel::setData ( const QModelIndexList &  indexList,
const QVariant &  value,
int  role = Qt::EditRole 
)

Definition at line 641 of file foldertablemodel.cpp.

References flags(), index(), and setData().

Here is the call graph for this function:

bool FolderTableModel::canSetDisplayAsMask ( const QModelIndex &  index  )  const

Definition at line 900 of file foldertablemodel.cpp.

Referenced by canSetDisplayAsMask(), and FolderTableView::contextMenuEvent().

bool FolderTableModel::canSetDisplayAsMask ( const QModelIndexList &  indexList  )  const

Definition at line 907 of file foldertablemodel.cpp.

References canSetDisplayAsMask(), and index().

Here is the call graph for this function:

bool FolderTableModel::setHeaderData ( int  section,
Qt::Orientation  orientation,
const QVariant &  value,
int  role = Qt::EditRole 
)

Definition at line 207 of file foldertablemodel.cpp.

bool FolderTableModel::removeRows ( int  row,
int  count = 1,
const QModelIndex &  parent = QModelIndex() 
)

bool FolderTableModel::insertRows ( int  row,
int  count = 1,
const QModelIndex &  parent = QModelIndex() 
)

QVariant::Type FolderTableModel::getQVariantType ( const std::string &  coolType  )  const

QVariant::Type FolderTableModel::getQVariantType ( const QModelIndex &  index  )  const

Definition at line 313 of file foldertablemodel.cpp.

References RootFolderTableItem::headerType(), and rootTableItem.

Here is the call graph for this function:

QVariant::Type FolderTableModel::getQVariantType ( const QString &  field  )  const

Definition at line 321 of file foldertablemodel.cpp.

References RootFolderTableItem::headerPos(), RootFolderTableItem::headerType(), and rootTableItem.

Here is the call graph for this function:

QVariant::Type FolderTableModel::getQVariantType ( int  column  )  const

Definition at line 332 of file foldertablemodel.cpp.

References columnCount(), RootFolderTableItem::headerType(), and rootTableItem.

Here is the call graph for this function:

QString FolderTableModel::getCoolTypeString ( const QModelIndex &  index  )  const

RootFolderTableItem * FolderTableModel::getRootTableItem (  )  const

void FolderTableModel::setDefaultCopyRow ( int  row  ) 

Definition at line 353 of file foldertablemodel.cpp.

References defaultCopyRow, and rowCount().

Referenced by FolderTableView::slotNewRow().

Here is the call graph for this function:

QList< int > FolderTableModel::filter ( FilterFunction0  f,
bool  inverse,
bool  allChannels = true,
int  rowStartPos = -1,
int  rowEndPos = -1 
)

Definition at line 362 of file foldertablemodel.cpp.

References RootFolderTableItem::child(), FolderTableItem::getChannelId(), getRootTableItem(), and rowCount().

Referenced by filter_mre_singleChannel(), and filter_mres().

Here is the call graph for this function:

QList< int > FolderTableModel::filter_mres ( bool  inverse = true  ) 

Definition at line 411 of file foldertablemodel.cpp.

References filter(), and filter_mre().

Here is the call graph for this function:

int FolderTableModel::filter_mre_singleChannel ( int  row  ) 

Definition at line 423 of file foldertablemodel.cpp.

References RootFolderTableItem::child(), data(), filter(), filter_mre(), and getRootTableItem().

Referenced by _updateValidityKeys().

Here is the call graph for this function:

bool FolderTableModel::filter_mre ( int  row  ) 

Definition at line 417 of file foldertablemodel.cpp.

References RootFolderTableItem::child(), FolderTableItem::data(), and getRootTableItem().

Referenced by filter_mre_singleChannel(), and filter_mres().

Here is the call graph for this function:

QList< FolderTableItem * > FolderTableModel::_updateValidityKeys ( QList< FolderTableItem * >  newTableItems  ) 

bool FolderTableModel::commit (  ) 

bool FolderTableModel::isNewRow ( int  row  )  const

Definition at line 618 of file foldertablemodel.cpp.

References RootFolderTableItem::child(), FolderTableItem::isNew(), and rootTableItem.

Referenced by FolderTableDelegate::createEditor(), and FolderTableView::testSelection().

Here is the call graph for this function:

DisplayAsMask FolderTableModel::getDisplayAsMask ( int  column  )  const

ColumnResponse FolderTableModel::getColumnResponse ( int  column  )  const

Definition at line 864 of file foldertablemodel.cpp.

References columnResponseHash, and noResponse.

Referenced by FolderTableDelegate::createEditor().

bool FolderTableModel::hasMask ( int  column  )  const

Definition at line 870 of file foldertablemodel.cpp.

References displayAsMaskHash.

Referenced by data().

void FolderTableModel::setDisplayAsMask ( const QModelIndex &  index,
DisplayAsMask  dMask 
)

QString FolderTableModel::getInputMask ( const QModelIndex &  index  )  const

Definition at line 1000 of file foldertablemodel.cpp.

Referenced by FolderTableDelegate::createEditor().

QVariant FolderTableModel::getMaskedData ( FolderTableItem *&  item,
int  column 
) const

Definition at line 766 of file foldertablemodel.cpp.

References applyMaskToQVariant(), blobMask, clobMask, FolderTableItem::data(), datetimeMask, decMask, getDisplayAsMask(), hexMask, noMask, and octMask.

Referenced by data().

Here is the call graph for this function:

QValidator * FolderTableModel::getValidator ( const QModelIndex &  index  )  const

Definition at line 1005 of file foldertablemodel.cpp.

Referenced by FolderTableDelegate::createEditor().

QValidator * FolderTableModel::getValidator ( unsigned int  column  )  const

Definition at line 1010 of file foldertablemodel.cpp.

References blobMask, clobMask, datetimeMask, decMask, getDisplayAsMask(), getQVariantType(), RootFolderTableItem::headerType(), hexMask, noMask, octMask, and rootTableItem.

Here is the call graph for this function:

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

Definition at line 1095 of file foldertablemodel.cpp.

References rootTableItem, and RootFolderTableItem::sort().

Here is the call graph for this function:

int FolderTableModel::compare ( const QModelIndex &  index,
QString  value 
)

Definition at line 1102 of file foldertablemodel.cpp.

References blobMask, clobMask, compareQVariants(), decMask, getDisplayAsMask(), hexMask, octMask, qStringToQVariant(), and rawData().

Referenced by FilterEntry::filter_nonDate().

Here is the call graph for this function:

int FolderTableModel::compareQVariants ( QVariant  A,
QVariant  B 
)

Definition at line 1144 of file foldertablemodel.cpp.

Referenced by compare().

void FolderTableModel::setFiltered ( bool  enabled = true  ) 

Definition at line 1193 of file foldertablemodel.cpp.

References filtered.

Referenced by FolderTableView::showAllRows(), and FolderTableView::slotApplyFilter().

bool FolderTableModel::isFiltered (  )  const

QSet< unsigned int > FolderTableModel::newRowChannelIds ( QList< FolderTableItem * >  newTableItems = QList< FolderTableItem* >()  )  const

Definition at line 627 of file foldertablemodel.cpp.

References FolderTableItem::getChannelId(), RootFolderTableItem::newItems(), and rootTableItem.

Referenced by FolderTableView::slotNewRow().

Here is the call graph for this function:

void FolderTableModel::setupFolderTableModelData ( cool::ValidityKey  start,
cool::ValidityKey  end,
cool::ChannelSelection  channels,
QString  tag 
) [private]

QVariant FolderTableModel::qStringToQVariant ( QString  value,
bool *  ok,
int  column,
int  base = 0 
) [private]

Definition at line 917 of file foldertablemodel.cpp.

References getQVariantType().

Referenced by compare(), setData(), and setupFolderTableModelData().

Here is the call graph for this function:

QVariant FolderTableModel::applyMaskToQVariant ( QString  format,
QVariant  currentValue,
int  column,
bool *  ok,
int  fieldWidth = 1,
int  base = 10,
const QChar &  fillChar = QLatin1Char( ' ' ) 
) const [private]

Definition at line 966 of file foldertablemodel.cpp.

References getQVariantType().

Referenced by getMaskedData().

Here is the call graph for this function:

void FolderTableModel::modelChanged ( const FolderTableModel thisModel,
const bool  changed 
) [signal]

Referenced by commit(), insertRows(), and removeRows().


Member Data Documentation

cool::IFolderPtr FolderTableModel::coolFolderPtr [private]

Definition at line 81 of file foldertablemodel.h.

Referenced by commit(), and setupFolderTableModelData().

const cool::IRecordSpecification& FolderTableModel::payloadSpec [private]

Definition at line 82 of file foldertablemodel.h.

Referenced by commit(), and setupFolderTableModelData().

Definition at line 83 of file foldertablemodel.h.

Referenced by isFiltered(), and setFiltered().

Definition at line 85 of file foldertablemodel.h.

Referenced by FolderTableModel(), insertRows(), and setDefaultCopyRow().

QString FolderTableModel::newRowColour [private]

Definition at line 86 of file foldertablemodel.h.

Referenced by data(), and FolderTableModel().

Definition at line 86 of file foldertablemodel.h.

Referenced by FolderTableModel().

QString FolderTableModel::maskColour [private]

Definition at line 86 of file foldertablemodel.h.

Referenced by data(), and FolderTableModel().

Definition at line 86 of file foldertablemodel.h.

Referenced by data(), and FolderTableModel().

Definition at line 88 of file foldertablemodel.h.

Referenced by flags(), FolderTableModel(), and getColumnResponse().


Generated on Wed Oct 8 14:59:46 2008 for ACE - A COOL Editor by  doxygen 1.5.6