QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsProjectStoredObjectManagerModel< T > Class Template Reference

Template class for models representing the objects available in a QgsAbstractProjectStoredObjectManager. More...

#include <qgsprojectstoredobjectmanagermodel.h>

Inheritance diagram for QgsProjectStoredObjectManagerModel< T >:

Public Member Functions

 QgsProjectStoredObjectManagerModel (QgsAbstractProjectStoredObjectManager< T > *manager, QObject *parent=nullptr)
 Constructor for QgsProjectStoredObjectManagerModel, showing the objects from the specified manager.
bool allowEmptyObject () const
 Returns true if the model allows the empty object ("not set") choice.
QModelIndex indexFromObject (T *object) const
 Returns the model index corresponding to an object.
T * objectFromIndex (const QModelIndex &index) const
 Returns the object at the corresponding index.
void setAllowEmptyObject (bool allowEmpty)
 Sets whether an optional empty object ("not set") option is present in the model.
Public Member Functions inherited from QgsProjectStoredObjectManagerModelBase
 QgsProjectStoredObjectManagerModelBase (QObject *parent=nullptr)
 Constructor for QgsProjectStoredObjectManagerModelBase, with the specified parent object.
QVariant data (const QModelIndex &index, int role) const override
Qt::ItemFlags flags (const QModelIndex &index) const override
int rowCount (const QModelIndex &parent) const override
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override

Protected Attributes

PRIVATE QgsAbstractProjectStoredObjectManager< T > * mObjectManager = nullptr
 Object manager.

Additional Inherited Members

Public Types inherited from QgsProjectStoredObjectManagerModelBase
enum class  CustomRole : int { Object = Qt::UserRole + 1 }
 Custom model roles. More...

Detailed Description

template<class T>
class QgsProjectStoredObjectManagerModel< T >

Template class for models representing the objects available in a QgsAbstractProjectStoredObjectManager.

Since
QGIS 4.0

Definition at line 102 of file qgsprojectstoredobjectmanagermodel.h.

Constructor & Destructor Documentation

◆ QgsProjectStoredObjectManagerModel()

template<class T>
QgsProjectStoredObjectManagerModel< T >::QgsProjectStoredObjectManagerModel ( QgsAbstractProjectStoredObjectManager< T > * manager,
QObject * parent = nullptr )
explicit

Constructor for QgsProjectStoredObjectManagerModel, showing the objects from the specified manager.

Definition at line 79 of file qgsprojectstoredobjectmanagermodel.cpp.

Member Function Documentation

◆ allowEmptyObject()

template<class T>
bool QgsProjectStoredObjectManagerModel< T >::allowEmptyObject ( ) const
inline

Returns true if the model allows the empty object ("not set") choice.

See also
setAllowEmptyObject()

Definition at line 134 of file qgsprojectstoredobjectmanagermodel.h.

◆ indexFromObject()

template<class T>
QModelIndex QgsProjectStoredObjectManagerModel< T >::indexFromObject ( T * object) const

Returns the model index corresponding to an object.

See also
objectFromIndex()

Definition at line 252 of file qgsprojectstoredobjectmanagermodel.cpp.

◆ objectFromIndex()

template<class T>
T * QgsProjectStoredObjectManagerModel< T >::objectFromIndex ( const QModelIndex & index) const

Returns the object at the corresponding index.

See also
indexFromObject()

Definition at line 240 of file qgsprojectstoredobjectmanagermodel.cpp.

◆ setAllowEmptyObject()

template<class T>
void QgsProjectStoredObjectManagerModel< T >::setAllowEmptyObject ( bool allowEmpty)

Sets whether an optional empty object ("not set") option is present in the model.

See also
allowEmptyObject()

Definition at line 273 of file qgsprojectstoredobjectmanagermodel.cpp.

Member Data Documentation

◆ mObjectManager

template<class T>
PRIVATE QgsAbstractProjectStoredObjectManager<T>* QgsProjectStoredObjectManagerModel< T >::mObjectManager = nullptr
protected

Object manager.

Definition at line 153 of file qgsprojectstoredobjectmanagermodel.h.


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