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

Model for rule based rendering rules view. More...

#include <qgsrulebasedlabelingwidget.h>

Inheritance diagram for QgsRuleBasedLabelingModel:
Inheritance graph
[legend]

Public Member Functions

 QgsRuleBasedLabelingModel (QgsRuleBasedLabeling::Rule *rootRule, QObject *parent=nullptr)
 constructor
 
int columnCount (const QModelIndex &=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
 
void finishedAddingRules ()
 Notify the model that one is done inserting new rules.
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 provide model index for parent's child item
 
void insertRule (const QModelIndex &parent, int before, QgsRuleBasedLabeling::Rule *newrule)
 Inserts a new rule at the specified position.
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
QModelIndex parent (const QModelIndex &index) const override
 provide parent model index
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
void removeRule (const QModelIndex &index)
 Removes the rule at the specified position.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QgsRuleBasedLabeling::RuleruleForIndex (const QModelIndex &index) const
 Returns the rule at the specified index.
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
Qt::DropActions supportedDropActions () const override
 
void updateRule (const QModelIndex &index)
 Update rule and all its descendants.
 
void updateRule (const QModelIndex &parent, int row)
 Updates the rule at the specified position.
 
void willAddRules (const QModelIndex &parent, int count)
 Notify the model that new rules will be added.
 

Protected Attributes

QgsRuleBasedLabeling::RulemRootRule = nullptr
 

Detailed Description

Model for rule based rendering rules view.

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

Definition at line 41 of file qgsrulebasedlabelingwidget.h.

Constructor & Destructor Documentation

◆ QgsRuleBasedLabelingModel()

QgsRuleBasedLabelingModel::QgsRuleBasedLabelingModel ( QgsRuleBasedLabeling::Rule rootRule,
QObject *  parent = nullptr 
)

constructor

Definition at line 299 of file qgsrulebasedlabelingwidget.cpp.

Member Function Documentation

◆ columnCount()

int QgsRuleBasedLabelingModel::columnCount ( const QModelIndex &  = QModelIndex()) const
override

Definition at line 419 of file qgsrulebasedlabelingwidget.cpp.

◆ data()

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

Definition at line 318 of file qgsrulebasedlabelingwidget.cpp.

◆ dropMimeData()

bool QgsRuleBasedLabelingModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
override

Definition at line 558 of file qgsrulebasedlabelingwidget.cpp.

◆ finishedAddingRules()

void QgsRuleBasedLabelingModel::finishedAddingRules ( )

Notify the model that one is done inserting new rules.

See also
willAddRules()

◆ flags()

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

Definition at line 305 of file qgsrulebasedlabelingwidget.cpp.

◆ headerData()

QVariant QgsRuleBasedLabelingModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 397 of file qgsrulebasedlabelingwidget.cpp.

◆ index()

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

provide model index for parent's child item

Definition at line 424 of file qgsrulebasedlabelingwidget.cpp.

◆ insertRule()

void QgsRuleBasedLabelingModel::insertRule ( const QModelIndex &  parent,
int  before,
QgsRuleBasedLabeling::Rule newrule 
)

Inserts a new rule at the specified position.

Definition at line 637 of file qgsrulebasedlabelingwidget.cpp.

◆ mimeData()

QMimeData * QgsRuleBasedLabelingModel::mimeData ( const QModelIndexList &  indexes) const
override

Definition at line 524 of file qgsrulebasedlabelingwidget.cpp.

◆ mimeTypes()

QStringList QgsRuleBasedLabelingModel::mimeTypes ( ) const
override

Definition at line 501 of file qgsrulebasedlabelingwidget.cpp.

◆ parent()

QModelIndex QgsRuleBasedLabelingModel::parent ( const QModelIndex &  index) const
override

provide parent model index

Definition at line 435 of file qgsrulebasedlabelingwidget.cpp.

◆ removeRows()

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

Definition at line 604 of file qgsrulebasedlabelingwidget.cpp.

◆ removeRule()

void QgsRuleBasedLabelingModel::removeRule ( const QModelIndex &  index)

Removes the rule at the specified position.

◆ rowCount()

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

Definition at line 409 of file qgsrulebasedlabelingwidget.cpp.

◆ ruleForIndex()

QgsRuleBasedLabeling::Rule * QgsRuleBasedLabelingModel::ruleForIndex ( const QModelIndex &  index) const

Returns the rule at the specified index.

Definition at line 630 of file qgsrulebasedlabelingwidget.cpp.

◆ setData()

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

Definition at line 452 of file qgsrulebasedlabelingwidget.cpp.

◆ supportedDropActions()

Qt::DropActions QgsRuleBasedLabelingModel::supportedDropActions ( ) const
override

Definition at line 496 of file qgsrulebasedlabelingwidget.cpp.

◆ updateRule() [1/2]

void QgsRuleBasedLabelingModel::updateRule ( const QModelIndex &  index)

Update rule and all its descendants.

◆ updateRule() [2/2]

void QgsRuleBasedLabelingModel::updateRule ( const QModelIndex &  parent,
int  row 
)

Updates the rule at the specified position.

Definition at line 647 of file qgsrulebasedlabelingwidget.cpp.

◆ willAddRules()

void QgsRuleBasedLabelingModel::willAddRules ( const QModelIndex &  parent,
int  count 
)

Notify the model that new rules will be added.

Member Data Documentation

◆ mRootRule

QgsRuleBasedLabeling::Rule* QgsRuleBasedLabelingModel::mRootRule = nullptr
protected

Definition at line 94 of file qgsrulebasedlabelingwidget.h.


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