QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsAttributesFormBaseView Class Reference

Graphical representation for the attribute drag and drop editor. More...

#include <qgsattributesformview.h>

Inheritance diagram for QgsAttributesFormBaseView:

Public Slots

void selectFirstMatchingItem (const QgsAttributesFormData::AttributesFormItemType &itemType, const QString &itemId)
 Selects the first item that matches a itemType and a itemId.
void setFilterText (const QString &text)
 Sets the filter text to the underlying proxy model.

Public Member Functions

 QgsAttributesFormBaseView (QgsVectorLayer *layer, QWidget *parent=nullptr)
 Constructor for QgsAttributesFormBaseView, with the given parent.
void addIndicator (QgsAttributesFormItem *item, QgsAttributesFormTreeViewIndicator *indicator)
 Adds the indicator to the given item.
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context.
QModelIndex firstSelectedIndex () const
 Returns the source model index corresponding to the first selected row.
const QList< QgsAttributesFormTreeViewIndicator * > indicators (const QModelIndex &index) const
 Returns the list of indicators associated with a given index.
const QList< QgsAttributesFormTreeViewIndicator * > indicators (QgsAttributesFormItem *item) const
 Returns the list of indicators associated with a given item.
void removeAllIndicators ()
 Removes all indicators in the current view.
void removeIndicator (QgsAttributesFormItem *item, QgsAttributesFormTreeViewIndicator *indicator)
 Removes the indicator from the given item.
QgsAttributesFormModelsourceModel () const
 Returns the underlying QgsAttributesFormModel model where the view gets data from.
Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default

Protected Attributes

QHash< QgsAttributesFormItem *, QList< QgsAttributesFormTreeViewIndicator * > > mIndicators
 Storage of indicators used with the tree view.
QgsVectorLayermLayer = nullptr
QgsAttributesFormProxyModelmModel = nullptr

Detailed Description

Graphical representation for the attribute drag and drop editor.

Warning
Not part of stable API and may change in future QGIS releases.
Since
QGIS 3.44

Definition at line 36 of file qgsattributesformview.h.

Constructor & Destructor Documentation

◆ QgsAttributesFormBaseView()

QgsAttributesFormBaseView::QgsAttributesFormBaseView ( QgsVectorLayer * layer,
QWidget * parent = nullptr )
explicit

Constructor for QgsAttributesFormBaseView, with the given parent.

The given layer is used to build an expression context with the layer scope.

Definition at line 49 of file qgsattributesformview.cpp.

Member Function Documentation

◆ addIndicator()

void QgsAttributesFormBaseView::addIndicator ( QgsAttributesFormItem * item,
QgsAttributesFormTreeViewIndicator * indicator )

Adds the indicator to the given item.

Since
QGIS 4.0

Definition at line 114 of file qgsattributesformview.cpp.

◆ createExpressionContext()

QgsExpressionContext QgsAttributesFormBaseView::createExpressionContext ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Implements QgsExpressionContextGenerator.

Definition at line 63 of file qgsattributesformview.cpp.

◆ firstSelectedIndex()

QModelIndex QgsAttributesFormBaseView::firstSelectedIndex ( ) const

Returns the source model index corresponding to the first selected row.

Note
The first selected row is the first one the user selected, and not necessarily the one closer to the header.

Definition at line 55 of file qgsattributesformview.cpp.

◆ indicators() [1/2]

const QList< QgsAttributesFormTreeViewIndicator * > QgsAttributesFormBaseView::indicators ( const QModelIndex & index) const

Returns the list of indicators associated with a given index.

Since
QGIS 4.0

Definition at line 103 of file qgsattributesformview.cpp.

◆ indicators() [2/2]

const QList< QgsAttributesFormTreeViewIndicator * > QgsAttributesFormBaseView::indicators ( QgsAttributesFormItem * item) const

Returns the list of indicators associated with a given item.

Since
QGIS 4.0

Definition at line 109 of file qgsattributesformview.cpp.

◆ removeAllIndicators()

void QgsAttributesFormBaseView::removeAllIndicators ( )

Removes all indicators in the current view.

Since
QGIS 4.0

Definition at line 134 of file qgsattributesformview.cpp.

◆ removeIndicator()

void QgsAttributesFormBaseView::removeIndicator ( QgsAttributesFormItem * item,
QgsAttributesFormTreeViewIndicator * indicator )

Removes the indicator from the given item.

Since
QGIS 4.0

Definition at line 128 of file qgsattributesformview.cpp.

◆ selectFirstMatchingItem

void QgsAttributesFormBaseView::selectFirstMatchingItem ( const QgsAttributesFormData::AttributesFormItemType & itemType,
const QString & itemId )
slot

Selects the first item that matches a itemType and a itemId.

Helps to keep in sync selection from both Attribute Widget view and Form Layout view.

Definition at line 76 of file qgsattributesformview.cpp.

◆ setFilterText

void QgsAttributesFormBaseView::setFilterText ( const QString & text)
slot

Sets the filter text to the underlying proxy model.

Parameters
textFilter text to be used to filter source model items.

Definition at line 98 of file qgsattributesformview.cpp.

◆ sourceModel()

QgsAttributesFormModel * QgsAttributesFormBaseView::sourceModel ( ) const

Returns the underlying QgsAttributesFormModel model where the view gets data from.

Since
QGIS 4.0

Definition at line 146 of file qgsattributesformview.cpp.

Member Data Documentation

◆ mIndicators

QHash< QgsAttributesFormItem *, QList< QgsAttributesFormTreeViewIndicator * > > QgsAttributesFormBaseView::mIndicators
protected

Storage of indicators used with the tree view.

Definition at line 121 of file qgsattributesformview.h.

◆ mLayer

QgsVectorLayer* QgsAttributesFormBaseView::mLayer = nullptr
protected

Definition at line 117 of file qgsattributesformview.h.

◆ mModel

QgsAttributesFormProxyModel* QgsAttributesFormBaseView::mModel = nullptr
protected

Definition at line 118 of file qgsattributesformview.h.


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