Classified ads
Signals | Public Member Functions | Private Attributes | List of all members
ContactListingModel Class Reference

Model-class for performing search on contact-list contacts This is supposed to act as an underlying data-container for an user-interface view (QTableView etc.) More...

#include <contactlistingmodel.h>

Inheritance diagram for ContactListingModel:
Inheritance graph
[legend]
Collaboration diagram for ContactListingModel:
Collaboration graph
[legend]

Signals

void error (MController::CAErrorSituation aError, const QString &aExplanation)
 

Public Member Functions

 ContactListingModel (Model &aModel, MController &aController)
 
 ~ContactListingModel ()
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
void newContactAdded (const Contact &aContact)
 
void removeContact (const Hash &aContact)
 
bool contactByFingerPrint (const Hash &aFingerPrint, Contact *aResultingContact) const
 
QVariant contactsAsQVariant () const
 
void setContactsFromQVariant (const QVariantList &aContacts)
 
bool isContactContained (const Hash &aFingerPrint) const
 
void clearContents ()
 
QList< HashtrustList () const
 

Private Attributes

ModeliModel
 
MControlleriController
 
QList< ContactiContacts
 

Detailed Description

Model-class for performing search on contact-list contacts This is supposed to act as an underlying data-container for an user-interface view (QTableView etc.)

Constructor & Destructor Documentation

◆ ContactListingModel()

ContactListingModel::ContactListingModel ( Model aModel,
MController aController 
)

◆ ~ContactListingModel()

ContactListingModel::~ContactListingModel ( )

Member Function Documentation

◆ clearContents()

void ContactListingModel::clearContents ( )

◆ columnCount()

virtual int ContactListingModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

re-implemented from QAbstractTableModel

Returns
number of columns in view

◆ contactByFingerPrint()

bool ContactListingModel::contactByFingerPrint ( const Hash aFingerPrint,
Contact aResultingContact 
) const

method for retrieving contact.

Parameters
aFingerPrinttells what to seek
aResultingContactwill have its field filled if match is made
Returns
true if contact was found

◆ contactsAsQVariant()

QVariant ContactListingModel::contactsAsQVariant ( ) const

whoever calls this method, must set Model.lock() first

◆ data()

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

re-implemented from QAbstractListModel

Returns
data to display in list

◆ error

void ContactListingModel::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal

◆ headerData()

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

◆ isContactContained()

bool ContactListingModel::isContactContained ( const Hash aFingerPrint) const

◆ newContactAdded()

void ContactListingModel::newContactAdded ( const Contact aContact)

◆ removeContact()

void ContactListingModel::removeContact ( const Hash aContact)

◆ rowCount()

virtual int ContactListingModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

◆ setContactsFromQVariant()

void ContactListingModel::setContactsFromQVariant ( const QVariantList &  aContacts)

◆ trustList()

QList<Hash> ContactListingModel::trustList ( ) const

method that returns subset of contacts that are marked as trusted

Member Data Documentation

◆ iContacts

QList<Contact> ContactListingModel::iContacts
private

◆ iController

MController& ContactListingModel::iController
private

◆ iModel

Model& ContactListingModel::iModel
private

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