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

The QgsLayerMetadataResultsModel class handles the metadata fetching from the registered layer metadata providers. More...

#include <qgslayermetadataresultsmodel.h>

Inheritance diagram for QgsLayerMetadataResultsModel:
Inheritance graph
[legend]

Public Types

enum class  CustomRole : int { Metadata = Qt::ItemDataRole::UserRole }
 The Roles enum represents the user roles for the model. More...
 
enum  Sections {
  Identifier , Title , Abstract , DataProviderName ,
  GeometryType
}
 The Sections enum represents the data columns. More...
 

Public Slots

void cancel ()
 Cancels the results fetching. More...
 
void resultsReady (const QgsLayerMetadataSearchResults &results)
 Triggered when metadata results have been fetched and can be added to the model. More...
 

Signals

void progressChanged (int progress)
 Emitted when the progress changed to progress. More...
 

Public Member Functions

 QgsLayerMetadataResultsModel (const QgsMetadataSearchContext &searchContext, QObject *parent=nullptr)
 Constructs a QgsLayerMetadataResultsModel from a searchContext and an optional parent. More...
 
 ~QgsLayerMetadataResultsModel ()
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
void reload ()
 Load/Reload model data synchronously. More...
 
void reloadAsync ()
 Load/Reload model data asynchronously using threads. More...
 
int rowCount (const QModelIndex &parent) const override
 

Detailed Description

The QgsLayerMetadataResultsModel class handles the metadata fetching from the registered layer metadata providers.

Since
QGIS 3.28

Definition at line 72 of file qgslayermetadataresultsmodel.h.

Member Enumeration Documentation

◆ CustomRole

The Roles enum represents the user roles for the model.

Note
Prior to QGIS 3.36 this was available as QgsLayerMetadataResultsModel::Roles
Since
QGIS 3.36
Enumerator
Metadata 

Layer metadata role.

Definition at line 108 of file qgslayermetadataresultsmodel.h.

◆ Sections

The Sections enum represents the data columns.

Enumerator
Identifier 

Metadata identifier.

Title 

Metadata title.

Abstract 

Metadata abstract.

DataProviderName 

Layer data provider name.

GeometryType 

Layer geometry type.

Definition at line 118 of file qgslayermetadataresultsmodel.h.

Constructor & Destructor Documentation

◆ QgsLayerMetadataResultsModel()

QgsLayerMetadataResultsModel::QgsLayerMetadataResultsModel ( const QgsMetadataSearchContext searchContext,
QObject *  parent = nullptr 
)
explicit

Constructs a QgsLayerMetadataResultsModel from a searchContext and an optional parent.

Definition at line 26 of file qgslayermetadataresultsmodel.cpp.

◆ ~QgsLayerMetadataResultsModel()

QgsLayerMetadataResultsModel::~QgsLayerMetadataResultsModel ( )

Definition at line 34 of file qgslayermetadataresultsmodel.cpp.

Member Function Documentation

◆ cancel

void QgsLayerMetadataResultsModel::cancel ( )
slot

Cancels the results fetching.

Definition at line 198 of file qgslayermetadataresultsmodel.cpp.

◆ columnCount()

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

Definition at line 44 of file qgslayermetadataresultsmodel.cpp.

◆ data()

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

Definition at line 49 of file qgslayermetadataresultsmodel.cpp.

◆ headerData()

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

Definition at line 117 of file qgslayermetadataresultsmodel.cpp.

◆ progressChanged

void QgsLayerMetadataResultsModel::progressChanged ( int  progress)
signal

Emitted when the progress changed to progress.

◆ reload()

void QgsLayerMetadataResultsModel::reload ( )

Load/Reload model data synchronously.

Definition at line 142 of file qgslayermetadataresultsmodel.cpp.

◆ reloadAsync()

void QgsLayerMetadataResultsModel::reloadAsync ( )

Load/Reload model data asynchronously using threads.

Definition at line 160 of file qgslayermetadataresultsmodel.cpp.

◆ resultsReady

void QgsLayerMetadataResultsModel::resultsReady ( const QgsLayerMetadataSearchResults results)
slot

Triggered when metadata results have been fetched and can be added to the model.

Definition at line 186 of file qgslayermetadataresultsmodel.cpp.

◆ rowCount()

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

Definition at line 39 of file qgslayermetadataresultsmodel.cpp.


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