Skip to content

Class QfMultiFeatureListModelBase

ClassList > QfMultiFeatureListModelBase

Inherits the following classes: QAbstractItemModel

Public Signals

Type Name
signal void countChanged
signal void selectedCountChanged

Public Functions

Type Name
QfMultiFeatureListModelBase (QObject * parent=nullptr)
void appendFeatures (const QList< QfIdentifyTool::IdentifyResult > & results)
bool canDeleteSelection () const
bool canDuplicateSelection () const
bool canEditAttributesSelection () const
bool canMergeSelection () const
bool canMoveSelection () const
bool canProcessSelection () const
bool canRotateSelection () const
void clear (const bool keepSelected=false)
void clearSelection ()
int columnCount (const QModelIndex & parent) override const
int count () const
QVariant data (const QModelIndex & index, int role) override const
bool deleteFeature (QgsVectorLayer * layer, QgsFeatureId fid, bool selectionAction=false)
bool deleteSelection ()
Deletes selected features.
bool duplicateFeature (QgsVectorLayer * layer, const QgsFeature & feature)
bool duplicateSelection ()
Duplicates selected features onto their associated layer.
QModelIndex index (int row, int column, const QModelIndex & parent=QModelIndex()) override const
bool mergeSelection ()
bool moveSelection (const double x, const double y, const QgsPoint & destinationPoint)
QModelIndex parent (const QModelIndex & child) override const
virtual bool removeRows (int row, int count, const QModelIndex & parent) override
QHash< int, QByteArray > roleNames () override const
bool rotateSelection (const double angle)
Rotate selected features along a given vector .
int rowCount (const QModelIndex & parent) override const
int selectedCount () const
QList< QgsFeature > selectedFeatures () const
QgsVectorLayer * selectedLayer () const
void setFeatures (const QMap< QgsVectorLayer *, QgsFeatureRequest > & requests)
void toggleSelectedItem (int item)

Public Signals Documentation

signal countChanged

void QfMultiFeatureListModelBase::countChanged;

signal selectedCountChanged

void QfMultiFeatureListModelBase::selectedCountChanged;

Public Functions Documentation

function QfMultiFeatureListModelBase

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

function appendFeatures

void QfMultiFeatureListModelBase::appendFeatures (
    const QList< QfIdentifyTool::IdentifyResult > & results
) 

Appends features from a list of results.


function canDeleteSelection

bool QfMultiFeatureListModelBase::canDeleteSelection () const

function canDuplicateSelection

bool QfMultiFeatureListModelBase::canDuplicateSelection () const

function canEditAttributesSelection

bool QfMultiFeatureListModelBase::canEditAttributesSelection () const

function canMergeSelection

bool QfMultiFeatureListModelBase::canMergeSelection () const

function canMoveSelection

bool QfMultiFeatureListModelBase::canMoveSelection () const

function canProcessSelection

bool QfMultiFeatureListModelBase::canProcessSelection () const

function canRotateSelection

bool QfMultiFeatureListModelBase::canRotateSelection () const

function clear

void QfMultiFeatureListModelBase::clear (
    const bool keepSelected=false
) 

Resets the model to either an empty feature list or one that contains only the selected features.

Parameters:

  • keepSelected if set to TRUE, selected features will be kept when resetting the model.

function clearSelection

void QfMultiFeatureListModelBase::clearSelection () 

Empties the list of selected features.


function columnCount

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

function count

int QfMultiFeatureListModelBase::count () const

function data

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

function deleteFeature

bool QfMultiFeatureListModelBase::deleteFeature (
    QgsVectorLayer * layer,
    QgsFeatureId fid,
    bool selectionAction=false
) 

Deletes a feature from a vector layer

Parameters:

  • layer The layer from which a feature will be removed
  • fid The id of the feature to remove
  • selectionAction

function deleteSelection

Deletes selected features.

bool QfMultiFeatureListModelBase::deleteSelection () 


function duplicateFeature

bool QfMultiFeatureListModelBase::duplicateFeature (
    QgsVectorLayer * layer,
    const QgsFeature & feature
) 

Duplicates a feature on a given layer

Parameters:

  • layer The layer within which the feature will be duplicated
  • feature The feature to be duplicated

function duplicateSelection

Duplicates selected features onto their associated layer.

bool QfMultiFeatureListModelBase::duplicateSelection () 


function index

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

function mergeSelection

bool QfMultiFeatureListModelBase::mergeSelection () 

Merges selected features by updating the first seleted feature's geometry to a combination (i.e. union) of geometries of all selected features.

All but the first feature will then be removed from the vector layer containing the selected features.


function moveSelection

bool QfMultiFeatureListModelBase::moveSelection (
    const double x,
    const double y,
    const QgsPoint & destinationPoint
) 

Moves selected feature(s) geometry by x and y. For a single feature with a singlepart point geometry containing Z and/or M values will adopt non-null values from the destinationPoint.


function parent

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

function removeRows

virtual bool QfMultiFeatureListModelBase::removeRows (
    int row,
    int count,
    const QModelIndex & parent
) override

Removes a defined number of rows starting from a given position. The parent index is not used as we have a list only.

Parameters:

  • row The first row to remove
  • count The numbe rof rows to remove
  • parent Can savely be omitted as it is unused and defaults to an invalid index

function roleNames

QHash< int, QByteArray > QfMultiFeatureListModelBase::roleNames () override const

function rotateSelection

Rotate selected features along a given vector .

bool QfMultiFeatureListModelBase::rotateSelection (
    const double angle
) 


function rowCount

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

function selectedCount

int QfMultiFeatureListModelBase::selectedCount () const

function selectedFeatures

QList< QgsFeature > QfMultiFeatureListModelBase::selectedFeatures () const

function selectedLayer

QgsVectorLayer * QfMultiFeatureListModelBase::selectedLayer () const

function setFeatures

void QfMultiFeatureListModelBase::setFeatures (
    const QMap< QgsVectorLayer *, QgsFeatureRequest > & requests
) 

Resets the model to contain features found from a list of requests.


function toggleSelectedItem

void QfMultiFeatureListModelBase::toggleSelectedItem (
    int item
) 

Toggles the selection state of a given item.

Parameters:

  • item the item's row number


The documentation for this class was generated from the following file src/core/qfmultifeaturelistmodelbase.h