AbstractModel Class Reference

The AbstractModel class provides an abstract base for all models in the Model-View-Controller system. More...

#include <abstractmodel.h>

Inheritance diagram for AbstractModel:

MvcBase DigestDbModel Doc SettingsModel AttributeDoc ElementDoc Diagram List of all members.

Public Member Functions

 AbstractModel (QObject *objectPtr)
virtual ~AbstractModel ()
AbstractControllercontroller () const

Protected Member Functions

virtual void dispatchEvent (MEvent *)
virtual void changeControllerEvent (MChangeControllerEvent *)
void postControllerEvent (CEvent *event)

Detailed Description

The AbstractModel class provides an abstract base for all models in the Model-View-Controller system.


Constructor & Destructor Documentation

AbstractModel::AbstractModel ( QObject *  objectPtr  ) 

Constructs an abstract model.

AbstractModel::~AbstractModel (  )  [virtual]

Destroys the abstract model.

If the controller() is non-null, this will post a CChangeModelEvent to it with null (0) as the parameter.


Member Function Documentation

AbstractController * AbstractModel::controller (  )  const

Returns the model's controller.

void AbstractModel::dispatchEvent ( MEvent event  )  [protected, virtual]

The model's event dispatcher.

Asserts that the event is non-null.

Warning! It is assumed that the events have their correct type set (as it uses static casts).

Reimplemented in AttributeDoc, Doc, ElementDoc, DigestDbModel, and SettingsModel.

void AbstractModel::changeControllerEvent ( MChangeControllerEvent event  )  [protected, virtual]

Changes the controller that the model should post messages to.

Typically, only a controller should post a MChangeControllerEvent to a model, as a result of a CChangeModelEvent being posted to it.

Asserts that the event is non-null.

Reimplemented in AttributeDoc, Doc, ElementDoc, Diagram, DigestDbModel, and SettingsModel.

void AbstractModel::postControllerEvent ( CEvent event  )  [protected]

Convenience method.

Equivalent to:

 QCoreApplication::postEvent( controller()->objectPtr(), event );


The documentation for this class was generated from the following files:
Generated on Mon Jul 30 09:46:51 2007 for Digest by  doxygen 1.5.2