QGIS API Documentation 3.41.0-Master (57ec4277f5e)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsLabelingEngineRulesModel Class Reference

A model for configuration of a list of labeling engine rules. More...

#include <qgslabelingengineruleswidget.h>

Inheritance diagram for QgsLabelingEngineRulesModel:
Inheritance graph
[legend]

Public Member Functions

 QgsLabelingEngineRulesModel (QObject *parent=nullptr)
 Constructor for QgsLabelingEngineRulesModel.
 
 ~QgsLabelingEngineRulesModel () override
 
void addRule (std::unique_ptr< QgsAbstractLabelingEngineRule > &rule)
 Adds a rule to the model.
 
void changeRule (const QModelIndex &index, std::unique_ptr< QgsAbstractLabelingEngineRule > &rule)
 Swaps the rule at the specified index for a new rule.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
QModelIndex parent (const QModelIndex &child) const override
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QgsAbstractLabelingEngineRuleruleAtIndex (const QModelIndex &index) const
 Returns the rule at the specified model index.
 
QList< QgsAbstractLabelingEngineRule * > rules () const
 Returns the rules shown in the widget.
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setRules (const QList< QgsAbstractLabelingEngineRule * > &rules)
 Sets the rules to include in the model.
 

Detailed Description

A model for configuration of a list of labeling engine rules.

Note
Not available in Python bindings
Since
QGIS 3.40

Definition at line 39 of file qgslabelingengineruleswidget.h.

Constructor & Destructor Documentation

◆ QgsLabelingEngineRulesModel()

QgsLabelingEngineRulesModel::QgsLabelingEngineRulesModel ( QObject *  parent = nullptr)
explicit

Constructor for QgsLabelingEngineRulesModel.

Definition at line 34 of file qgslabelingengineruleswidget.cpp.

◆ ~QgsLabelingEngineRulesModel()

QgsLabelingEngineRulesModel::~QgsLabelingEngineRulesModel ( )
overridedefault

Member Function Documentation

◆ addRule()

void QgsLabelingEngineRulesModel::addRule ( std::unique_ptr< QgsAbstractLabelingEngineRule > &  rule)

Adds a rule to the model.

Definition at line 190 of file qgslabelingengineruleswidget.cpp.

◆ changeRule()

void QgsLabelingEngineRulesModel::changeRule ( const QModelIndex &  index,
std::unique_ptr< QgsAbstractLabelingEngineRule > &  rule 
)

Swaps the rule at the specified index for a new rule.

Definition at line 208 of file qgslabelingengineruleswidget.cpp.

◆ columnCount()

int QgsLabelingEngineRulesModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 74 of file qgslabelingengineruleswidget.cpp.

◆ data()

QVariant QgsLabelingEngineRulesModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 80 of file qgslabelingengineruleswidget.cpp.

◆ flags()

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

Definition at line 39 of file qgslabelingengineruleswidget.cpp.

◆ index()

QModelIndex QgsLabelingEngineRulesModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const
override

Definition at line 116 of file qgslabelingengineruleswidget.cpp.

◆ parent()

QModelIndex QgsLabelingEngineRulesModel::parent ( const QModelIndex &  child) const
override

Definition at line 60 of file qgslabelingengineruleswidget.cpp.

◆ removeRows()

bool QgsLabelingEngineRulesModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Definition at line 126 of file qgslabelingengineruleswidget.cpp.

◆ rowCount()

int QgsLabelingEngineRulesModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 66 of file qgslabelingengineruleswidget.cpp.

◆ ruleAtIndex()

QgsAbstractLabelingEngineRule * QgsLabelingEngineRulesModel::ruleAtIndex ( const QModelIndex &  index) const

Returns the rule at the specified model index.

Definition at line 197 of file qgslabelingengineruleswidget.cpp.

◆ rules()

QList< QgsAbstractLabelingEngineRule * > QgsLabelingEngineRulesModel::rules ( ) const

Returns the rules shown in the widget.

The caller takes ownership of all returned rules.

Definition at line 220 of file qgslabelingengineruleswidget.cpp.

◆ setData()

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

Definition at line 143 of file qgslabelingengineruleswidget.cpp.

◆ setRules()

void QgsLabelingEngineRulesModel::setRules ( const QList< QgsAbstractLabelingEngineRule * > &  rules)

Sets the rules to include in the model.

Ownership is not transferred, an internal copy will be made.

Definition at line 179 of file qgslabelingengineruleswidget.cpp.


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