The AbstractObserverItemModel is an abstract base class which is used by all the different observer models in the Qtilities library. More...
#include <AbstractObserverItemModel.h>
Public Types | |
enum | ColumnID |
The possible columns which can be requested by views for an module. |
Public Member Functions | |
ObserverHints * | activeHints () 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 | |
Observer * | observerContext () const |
Gets a pointer to the observer context. |
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.
Qtilities::Core::ObserverHints * Qtilities::CoreGui::AbstractObserverItemModel::activeHints | ( | ) | const |
This function will provide the hints which should be used by this model at any time.
QString Qtilities::CoreGui::AbstractObserverItemModel::columnChildCountBaseClass | ( | ) | const |
Gets the base class to use for tree count operations in the ColumnChildCount column if shown.
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.
This function was added in Qtilities v1.1.
|
pure virtual |
The model implementation must return the index (starting at 0) for the requested column.
Implemented in Qtilities::CoreGui::ObserverTableModel, and Qtilities::CoreGui::ObserverTreeModel.
bool Qtilities::CoreGui::AbstractObserverItemModel::lazyInitEnabled | ( | ) | const |
Gets if lazy initialization is enabled.
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.
This function was added in Qtilities v1.1.
Reimplemented in Qtilities::CoreGui::ObserverTreeModel.
|
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().
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.
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.
|
virtual |
Sets if this model must be read only, thus its actions and property editor will be read only.
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.
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.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|