QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Types | Public Member Functions | List of all members
QgsGeoPdfLayerTreeModel Class Reference

Layer tree model for Geo-PDF layers. More...

#include <qgsgeopdflayertreemodel.h>

Inheritance diagram for QgsGeoPdfLayerTreeModel:
Inheritance graph
[legend]

Public Types

enum  Columns { LayerColumn = 0 , GroupColumn , InitiallyVisible , IncludeVectorAttributes }
 Model columns. More...
 
- Public Types inherited from QgsMapLayerModel
enum  ItemDataRole { LayerIdRole = Qt::UserRole + 1 , LayerRole , EmptyRole , AdditionalRole }
 Item data roles. More...
 

Public Member Functions

 QgsGeoPdfLayerTreeModel (const QList< QgsMapLayer * > &layers, QObject *parent=nullptr)
 constructor More...
 
void checkAll (bool checked, const QModelIndex &parent=QModelIndex(), int column=IncludeVectorAttributes)
 Checks (or unchecks) all rows and children from the specified parent index. More...
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &idx) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
- Public Member Functions inherited from QgsMapLayerModel
 QgsMapLayerModel (const QList< QgsMapLayer * > &layers, QObject *parent=nullptr, QgsProject *project=nullptr)
 QgsMapLayerModel creates a model to display a specific list of layers in a widget. More...
 
 QgsMapLayerModel (QObject *parent=nullptr, QgsProject *project=nullptr)
 QgsMapLayerModel creates a model to display layers in widgets. More...
 
QStringList additionalItems () const
 Returns the list of additional (non map layer) items included at the end of the model. More...
 
QList< QgsMapLayer * > additionalLayers () const
 Returns the list of additional layers added to the model. More...
 
bool allowEmptyLayer () const
 Returns true if the model allows the empty layer ("not set") choice. More...
 
bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
 
void checkAll (Qt::CheckState checkState)
 checkAll changes the checkstate for all the layers More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex indexFromLayer (QgsMapLayer *layer) const
 indexFromLayer returns the model index for a given layer More...
 
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
bool itemsCanBeReordered () const
 Returns true if items in the model can be reordered via drag and drop. More...
 
bool itemsCheckable () const
 returns if the items can be checked or not More...
 
QgsMapLayerlayerFromIndex (const QModelIndex &index) const
 Returns the map layer corresponding to the specified index. More...
 
QList< QgsMapLayer * > layersChecked (Qt::CheckState checkState=Qt::Checked)
 layersChecked returns the list of layers which are checked (or unchecked) More...
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
QModelIndex parent (const QModelIndex &child) const override
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
QHash< int, QByteArray > roleNames () const override
 Returns strings for all roles supported by this model. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
void setAdditionalItems (const QStringList &items)
 Sets a list of additional (non map layer) items to include at the end of the model. More...
 
void setAdditionalLayers (const QList< QgsMapLayer * > &layers)
 Sets a list of additional layers to include in the model. More...
 
void setAllowEmptyLayer (bool allowEmpty, const QString &text=QString(), const QIcon &icon=QIcon())
 Sets whether an optional empty layer ("not set") option is present in the model. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setItemsCanBeReordered (bool allow)
 Sets whether items in the model can be reordered via drag and drop. More...
 
void setItemsCheckable (bool checkable)
 setItemsCheckable defines if layers should be selectable in the widget More...
 
void setLayersChecked (const QList< QgsMapLayer * > &layers)
 Sets which layers are checked in the model. More...
 
void setProject (QgsProject *project)
 Sets the QgsProject from which map layers are shown. More...
 
void setShowCrs (bool showCrs)
 Sets whether the CRS of layers is also included in the model's display role. More...
 
bool showCrs () const
 Returns true if the model includes layer's CRS in the display role. More...
 
Qt::DropActions supportedDropActions () const override
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsMapLayerModel
static QIcon iconForLayer (QgsMapLayer *layer)
 Returns the icon corresponding to a specified map layer. More...
 
- Protected Slots inherited from QgsMapLayerModel
void addLayers (const QList< QgsMapLayer * > &layers)
 
void removeLayers (const QStringList &layerIds)
 
- Protected Attributes inherited from QgsMapLayerModel
QList< QPointer< QgsMapLayer > > mAdditionalLayers
 
bool mCanReorder = false
 
bool mItemCheckable = false
 
QList< QgsMapLayer * > mLayers
 
QMap< QString, Qt::CheckState > mLayersChecked
 
QgsProjectmProject = nullptr
 
- Properties inherited from QgsMapLayerModel
QStringList additionalItems
 
bool allowEmptyLayer
 
bool itemsCheckable
 
bool showCrs
 

Detailed Description

Layer tree model for Geo-PDF layers.

Note
This class is not a part of public API
Since
QGIS 3.12

Definition at line 39 of file qgsgeopdflayertreemodel.h.

Member Enumeration Documentation

◆ Columns

Model columns.

Enumerator
LayerColumn 

Layer name.

GroupColumn 

PDF group.

InitiallyVisible 

Initial visiblity state.

IncludeVectorAttributes 

Vector attribute.

Definition at line 46 of file qgsgeopdflayertreemodel.h.

Constructor & Destructor Documentation

◆ QgsGeoPdfLayerTreeModel()

QgsGeoPdfLayerTreeModel::QgsGeoPdfLayerTreeModel ( const QList< QgsMapLayer * > &  layers,
QObject *  parent = nullptr 
)

constructor

Definition at line 25 of file qgsgeopdflayertreemodel.cpp.

Member Function Documentation

◆ checkAll()

void QgsGeoPdfLayerTreeModel::checkAll ( bool  checked,
const QModelIndex &  parent = QModelIndex(),
int  column = IncludeVectorAttributes 
)

Checks (or unchecks) all rows and children from the specified parent index.

Definition at line 222 of file qgsgeopdflayertreemodel.cpp.

◆ columnCount()

int QgsGeoPdfLayerTreeModel::columnCount ( const QModelIndex &  parent) const
override

Definition at line 31 of file qgsgeopdflayertreemodel.cpp.

◆ data()

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

Definition at line 95 of file qgsgeopdflayertreemodel.cpp.

◆ flags()

Qt::ItemFlags QgsGeoPdfLayerTreeModel::flags ( const QModelIndex &  idx) const
override

Definition at line 37 of file qgsgeopdflayertreemodel.cpp.

◆ headerData()

QVariant QgsGeoPdfLayerTreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Definition at line 71 of file qgsgeopdflayertreemodel.cpp.

◆ setData()

bool QgsGeoPdfLayerTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

Definition at line 170 of file qgsgeopdflayertreemodel.cpp.


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