QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Types | Public Member Functions | List of all members
QgsLayoutManagerModel Class Reference

List model representing the print layouts and reports available in a layout manager. More...

#include <qgslayoutmanager.h>

Inheritance diagram for QgsLayoutManagerModel:
Inheritance graph
[legend]

Public Types

enum class  CustomRole : int { Layout = Qt::UserRole + 1 }
 Custom model roles. More...
 

Public Member Functions

 QgsLayoutManagerModel (QgsLayoutManager *manager, QObject *parent=nullptr)
 Constructor for QgsLayoutManagerModel, showing the layouts from the specified manager. More...
 
bool allowEmptyLayout () const
 Returns true if the model allows the empty layout ("not set") choice. More...
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QModelIndex indexFromLayout (QgsMasterLayoutInterface *layout) const
 Returns the model index corresponding to a layout. More...
 
QgsMasterLayoutInterfacelayoutFromIndex (const QModelIndex &index) const
 Returns the layout at the corresponding index. More...
 
int rowCount (const QModelIndex &parent) const override
 
void setAllowEmptyLayout (bool allowEmpty)
 Sets whether an optional empty layout ("not set") option is present in the model. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 

Detailed Description

List model representing the print layouts and reports available in a layout manager.

Since
QGIS 3.8

Definition at line 171 of file qgslayoutmanager.h.

Member Enumeration Documentation

◆ CustomRole

enum class QgsLayoutManagerModel::CustomRole : int
strong

Custom model roles.

Note
Prior to QGIS 3.36 this was available as QgsLayoutManagerModel::Role
Since
QGIS 3.36
Enumerator
Layout 

Layout object.

Definition at line 185 of file qgslayoutmanager.h.

Constructor & Destructor Documentation

◆ QgsLayoutManagerModel()

QgsLayoutManagerModel::QgsLayoutManagerModel ( QgsLayoutManager manager,
QObject *  parent = nullptr 
)
explicit

Constructor for QgsLayoutManagerModel, showing the layouts from the specified manager.

Definition at line 338 of file qgslayoutmanager.cpp.

Member Function Documentation

◆ allowEmptyLayout()

bool QgsLayoutManagerModel::allowEmptyLayout ( ) const
inline

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

See also
setAllowEmptyLayout()

Definition at line 224 of file qgslayoutmanager.h.

◆ data()

QVariant QgsLayoutManagerModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 355 of file qgslayoutmanager.cpp.

◆ flags()

Qt::ItemFlags QgsLayoutManagerModel::flags ( const QModelIndex &  index) const
override

Definition at line 436 of file qgslayoutmanager.cpp.

◆ indexFromLayout()

QModelIndex QgsLayoutManagerModel::indexFromLayout ( QgsMasterLayoutInterface layout) const

Returns the model index corresponding to a layout.

See also
layoutFromIndex()

Definition at line 465 of file qgslayoutmanager.cpp.

◆ layoutFromIndex()

QgsMasterLayoutInterface * QgsLayoutManagerModel::layoutFromIndex ( const QModelIndex &  index) const

Returns the layout at the corresponding index.

See also
indexFromLayout()

Definition at line 452 of file qgslayoutmanager.cpp.

◆ rowCount()

int QgsLayoutManagerModel::rowCount ( const QModelIndex &  parent) const
override

Definition at line 349 of file qgslayoutmanager.cpp.

◆ setAllowEmptyLayout()

void QgsLayoutManagerModel::setAllowEmptyLayout ( bool  allowEmpty)

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

See also
allowEmptyLayout()

Definition at line 485 of file qgslayoutmanager.cpp.

◆ setData()

bool QgsLayoutManagerModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Definition at line 392 of file qgslayoutmanager.cpp.


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