All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions
Qtilities::CoreGui::AbstractObserverItemModel Class Reference

The AbstractObserverItemModel is an abstract base class which is used by all the different observer models in the Qtilities library. More...

#include <AbstractObserverItemModel.h>

Inheritance diagram for Qtilities::CoreGui::AbstractObserverItemModel:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ColumnID
 The possible columns which can be requested by views for an module.

Public Member Functions

ObserverHintsactiveHints () const
 This function will provide the hints which should be used by this model at any time.
QString columnChildCountBaseClass () const
 Gets the base class to use for tree count operations in the ColumnChildCount column if shown.
int columnChildCountLimit () const
 Gets the upper limit to use for tree count operations in the ColumnChildCount column if shown.
virtual int columnPosition (ColumnID column_id) const =0
 The model implementation must return the index (starting at 0) for the requested column.
virtual QObject * getObject (const QModelIndex &index) const =0
 Abstract function which must be implemented to get the object at the given index.
virtual int getSubjectID (const QModelIndex &index) const =0
 Abstract function which must be implemented to get the subject ID of the object at the given index.
bool lazyInitEnabled () const
 Gets if lazy initialization is enabled.
bool readOnly () const
 Gets if this model must be read only, thus its actions and property editor will be read only.
virtual void refresh ()=0
 Forces this model to refresh its layout.
bool respondToObserverChanges () const
 Gets if this model responds to changes from the observer context displayed.
void setColumnChildCountBaseClass (const QString &base_class_name)
 Sets the base class to use for tree count operations in the ColumnChildCount column if shown.
void setColumnChildCountLimit (int limit)
 Sets the upper limit tree count operations in the ColumnChildCount column if shown.
bool setCustomHints (ObserverHints *custom_hints)
 This function allows you to copy the custom hints used by this model from a different ObserverHints instance.
virtual bool setObserverContext (Observer *observer)
 Implement the virtual function to get references to known filters.
virtual void setReadOnly (bool read_only)
 Sets if this model must be read only, thus its actions and property editor will be read only.
void setRespondToObserverChanges (bool respond_to_observer_changes)
 Sets if this model responds to changes from the observer context displayed.
void toggleLazyInit (bool enabled)
 Enables/disables lazy initialization.
void toggleUseObserverHints (bool toggle)
 Function to toggle usage of hints from the active parent observer. If not custom hints will be used.
bool usesObserverHints () const
 Function to indicate if observer hints are used in this model. If not, the default hints in the model base class is used.
- Public Member Functions inherited from Qtilities::Core::ObserverAwareBase
ObserverobserverContext () const
 Gets a pointer to the observer context.

Detailed Description

The AbstractObserverItemModel is an abstract base class which is used by all the different observer models in the Qtilities library.

This class inhertis ObserverAwareBase which is used to define the context (top level context in tree views) to be used in the model. The hints which should be used by the model is provided by the displayHints() function.


Member Function Documentation

Qtilities::Core::ObserverHints * Qtilities::CoreGui::AbstractObserverItemModel::activeHints ( ) const

This function will provide the hints which should be used by this model at any time.

See also:
toggleUseObserverHints()
QString Qtilities::CoreGui::AbstractObserverItemModel::columnChildCountBaseClass ( ) const

Gets the base class to use for tree count operations in the ColumnChildCount column if shown.

See also:
setColumnChildCountBaseClass()

This function was added in Qtilities v1.1.

int Qtilities::CoreGui::AbstractObserverItemModel::columnChildCountLimit ( ) const

Gets the upper limit to use for tree count operations in the ColumnChildCount column if shown.

See also:
setColumnChildCountLimit()

This function was added in Qtilities v1.1.

virtual int Qtilities::CoreGui::AbstractObserverItemModel::columnPosition ( ColumnID  column_id) const
pure virtual

The model implementation must return the index (starting at 0) for the requested column.

Note:
If your model does not support a specific column, return -1.
ColumnLast must return the number of columns you use in your model.

Implemented in Qtilities::CoreGui::ObserverTableModel, and Qtilities::CoreGui::ObserverTreeModel.

bool Qtilities::CoreGui::AbstractObserverItemModel::lazyInitEnabled ( ) const

Gets if lazy initialization is enabled.

See also:
toggleLazyInit()

This function was added in Qtilities v1.1.

bool Qtilities::CoreGui::AbstractObserverItemModel::readOnly ( ) const

Gets if this model must be read only, thus its actions and property editor will be read only.

See also:
setReadOnly()

This function was added in Qtilities v1.1.

Reimplemented in Qtilities::CoreGui::ObserverTreeModel.

virtual void Qtilities::CoreGui::AbstractObserverItemModel::refresh ( )
pure virtual

Forces this model to refresh its layout.

This function was added in Qtilities v1.1.

Implemented in Qtilities::CoreGui::ObserverTableModel, and Qtilities::CoreGui::ObserverTreeModel.

bool Qtilities::CoreGui::AbstractObserverItemModel::respondToObserverChanges ( ) const

Gets if this model responds to changes from the observer context displayed.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::AbstractObserverItemModel::setColumnChildCountBaseClass ( const QString &  base_class_name)

Sets the base class to use for tree count operations in the ColumnChildCount column if shown.

This base_class_name parameter will be passed on to Qtilities::Core::Observer::treeCount().

Note:
This function not refresh the view.
See also:
columnChildCountBaseClass()

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::AbstractObserverItemModel::setColumnChildCountLimit ( int  limit)

Sets the upper limit tree count operations in the ColumnChildCount column if shown.

This base_class_name parameter will be passed on to Qtilities::Core::Observer::treeCount().

The default is -1, thus not limit.

Note:
This function not refresh the view.
See also:
columnChildCountLimit()

This function was added in Qtilities v1.1.

bool Qtilities::CoreGui::AbstractObserverItemModel::setCustomHints ( ObserverHints custom_hints)

This function allows you to copy the custom hints used by this model from a different ObserverHints instance.

Note:
These hints are only used when usesObserverHints() is false.
The model will take ownership of the custom hints instance.
See also:
toggleUseObserverHints()
void Qtilities::CoreGui::AbstractObserverItemModel::setReadOnly ( bool  read_only)
virtual

Sets if this model must be read only, thus its actions and property editor will be read only.

See also:
readOnly()

This function was added in Qtilities v1.1.

Reimplemented in Qtilities::CoreGui::ObserverTreeModel.

void Qtilities::CoreGui::AbstractObserverItemModel::setRespondToObserverChanges ( bool  respond_to_observer_changes)

Sets if this model responds to changes from the observer context displayed.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::AbstractObserverItemModel::toggleLazyInit ( bool  enabled)

Enables/disables lazy initialization.

Lazy initialization means that the internal item view model won't initialize itself during the setObserverContext() call. Its usefull when using custom implemented proxy models etc. To initialize the model in lazy initialization mode call refresh().

Lazy initialization is disabled by default.

Note:
You must call this function before setObserverContext() for it to have any effect.
From the current models in Qtilities, only ObserverTreeModel makes use of lazy initialialization. For ObserverTableModel this is not neccesarry.
See also:
lazyInitEnabled()

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::AbstractObserverItemModel::toggleUseObserverHints ( bool  toggle)

Function to toggle usage of hints from the active parent observer. If not custom hints will be used.

See also:
activeHints(), setCustomHints()


Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé