KwicTableModel Class Reference

Model for table in gui holding the results of a query. More...

#include <kwicmodels.h>

Inherits QAbstractTableModel.

Inheritance diagram for KwicTableModel:

Inheritance graph
[legend]
Collaboration diagram for KwicTableModel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KwicTableModel (QObject *parent, PhraseHunter::ContextReader *reader)
 ~KwicTableModel ()
void setData (PhraseHunter::TokenPtr token)
void setData (const PhraseHunter::TokenVector &token)
int columnCount (const QModelIndex &parent=QModelIndex()) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
QVariant headerData (int, Qt::Orientation, int) const
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
QVariant getContextString (PhraseHunter::TokenContextPtr, const QModelIndex &) const
PhraseHunter::TokenContextPtr getContext (const QModelIndex &index) const
void setContextWidth (unsigned int width)

Private Attributes

PhraseHunter::ContextReaderm_reader
std::vector< PhraseHunter::TokenContextPtrentries
unsigned int m_width

Detailed Description

Model for table in gui holding the results of a query.

Definition at line 30 of file kwicmodels.h.


Constructor & Destructor Documentation

KwicTableModel::KwicTableModel ( QObject *  parent,
PhraseHunter::ContextReader reader 
)

Definition at line 49 of file kwicmodels.cpp.

KwicTableModel::~KwicTableModel (  )  [inline]

Definition at line 34 of file kwicmodels.h.


Member Function Documentation

void KwicTableModel::setData ( PhraseHunter::TokenPtr  token  ) 

Definition at line 116 of file kwicmodels.cpp.

References addAllOccurrences(), and entries.

Referenced by SearchTab::search().

void KwicTableModel::setData ( const PhraseHunter::TokenVector token  ) 

Definition at line 123 of file kwicmodels.cpp.

References addAllOccurrences(), and entries.

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

Definition at line 75 of file kwicmodels.cpp.

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

Definition at line 80 of file kwicmodels.cpp.

References entries.

QVariant KwicTableModel::headerData ( int  ,
Qt::Orientation  ,
int   
) const

Definition at line 54 of file kwicmodels.cpp.

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

Definition at line 109 of file kwicmodels.cpp.

References entries, and getContextString().

QVariant KwicTableModel::getContextString ( PhraseHunter::TokenContextPtr  ,
const QModelIndex &   
) const

Definition at line 85 of file kwicmodels.cpp.

References PhraseHunter::ContextReader::fillContext(), icuToQString(), m_reader, and m_width.

Referenced by data().

PhraseHunter::TokenContextPtr KwicTableModel::getContext ( const QModelIndex &  index  )  const [inline]

Definition at line 46 of file kwicmodels.h.

References entries.

Referenced by SearchTab::emitDocumentRequested().

void KwicTableModel::setContextWidth ( unsigned int  width  )  [inline]

Definition at line 53 of file kwicmodels.h.

References m_width.

Referenced by SearchTab::enableSearch(), and SearchTab::setContextWidth().


Member Data Documentation

PhraseHunter::ContextReader* KwicTableModel::m_reader [private]

Definition at line 59 of file kwicmodels.h.

Referenced by getContextString().

std::vector<PhraseHunter::TokenContextPtr> KwicTableModel::entries [private]

Definition at line 61 of file kwicmodels.h.

Referenced by data(), getContext(), rowCount(), and setData().

unsigned int KwicTableModel::m_width [private]

Definition at line 63 of file kwicmodels.h.

Referenced by getContextString(), and setContextWidth().


The documentation for this class was generated from the following files:
Generated on Thu Dec 21 16:14:41 2006 for The Phrasehunter by  doxygen 1.5.1