QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsAttributeDialog Class Reference

An attribute table dialog for a vector layer. More...

#include <qgsattributedialog.h>

Inheritance diagram for QgsAttributeDialog:

Public Slots

void accept () override
void reject () override
void show ()
 Show the dialog non-blocking. Reparents this dialog to be a child of the dialog form.

Public Member Functions

 QgsAttributeDialog (QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QWidget *parent=nullptr, bool showDialogButtons=true, const QgsAttributeEditorContext &context=QgsAttributeEditorContext())
 Create an attribute dialog for a given layer and feature.
 ~QgsAttributeDialog () override
QgsAttributeFormattributeForm () const
 Returns the attribute form.
QgsMapLayerActionContext createActionContext () override
 Creates a QgsMapLayerActionContext.
bool editable () const
 Is this dialog editable?
bool event (QEvent *e) override
 Intercept window activate/deactivate events to show/hide the highlighted feature.
const QgsFeaturefeature () const
 Returns the current feature of the attribute form.
void setEditCommandMessage (const QString &message)
 Sets the edit command message (Undo) that will be used when the dialog is accepted.
void setExtraContextScope (QgsExpressionContextScope *extraScope)
 Sets extraScope as an additional expression context scope to be used for calculations in this form.
void setHighlight (QgsHighlight *h)
 setHighlight
void setMode (QgsAttributeEditorContext::Mode mode)
 Toggles the form mode.
void showEvent (QShowEvent *event) override
Public Member Functions inherited from QgsMapLayerActionContextGenerator
virtual ~QgsMapLayerActionContextGenerator ()

Detailed Description

An attribute table dialog for a vector layer.

Definition at line 39 of file qgsattributedialog.h.

Constructor & Destructor Documentation

◆ QgsAttributeDialog()

QgsAttributeDialog::QgsAttributeDialog ( QgsVectorLayer * vl,
QgsFeature * thepFeature,
bool featureOwner,
QWidget * parent = nullptr,
bool showDialogButtons = true,
const QgsAttributeEditorContext & context = QgsAttributeEditorContext() )

Create an attribute dialog for a given layer and feature.

Parameters
vlThe layer for which the dialog will be generated
thepFeatureA feature for which the dialog will be generated
featureOwnerSet to true, if the dialog should take ownership of the feature
parentA parent widget for the dialog
showDialogButtonstrue: Show the dialog buttons accept/cancel
contextThe context in which this dialog is created

Definition at line 29 of file qgsattributedialog.cpp.

◆ ~QgsAttributeDialog()

QgsAttributeDialog::~QgsAttributeDialog ( )
override

Definition at line 36 of file qgsattributedialog.cpp.

Member Function Documentation

◆ accept

void QgsAttributeDialog::accept ( )
overrideslot

Definition at line 70 of file qgsattributedialog.cpp.

◆ attributeForm()

QgsAttributeForm * QgsAttributeDialog::attributeForm ( ) const
inline

Returns the attribute form.

Definition at line 69 of file qgsattributedialog.h.

◆ createActionContext()

QgsMapLayerActionContext QgsAttributeDialog::createActionContext ( )
overridevirtual

Creates a QgsMapLayerActionContext.

Implements QgsMapLayerActionContextGenerator.

Definition at line 186 of file qgsattributedialog.cpp.

◆ editable()

bool QgsAttributeDialog::editable ( ) const
inline

Is this dialog editable?

Returns
returns true, if this dialog was created in an editable manner.

Definition at line 81 of file qgsattributedialog.h.

◆ event()

bool QgsAttributeDialog::event ( QEvent * e)
override

Intercept window activate/deactivate events to show/hide the highlighted feature.

Parameters
eThe event
Returns
The same as the parent QDialog

Definition at line 171 of file qgsattributedialog.cpp.

◆ feature()

const QgsFeature * QgsAttributeDialog::feature ( ) const
inline

Returns the current feature of the attribute form.

Definition at line 74 of file qgsattributedialog.h.

◆ reject

void QgsAttributeDialog::reject ( )
overrideslot

Definition at line 107 of file qgsattributedialog.cpp.

◆ setEditCommandMessage()

void QgsAttributeDialog::setEditCommandMessage ( const QString & message)
inline

Sets the edit command message (Undo) that will be used when the dialog is accepted.

Parameters
messageThe message

Definition at line 95 of file qgsattributedialog.h.

◆ setExtraContextScope()

void QgsAttributeDialog::setExtraContextScope ( QgsExpressionContextScope * extraScope)

Sets extraScope as an additional expression context scope to be used for calculations in this form.

Since
QGIS 3.16

Definition at line 181 of file qgsattributedialog.cpp.

◆ setHighlight()

void QgsAttributeDialog::setHighlight ( QgsHighlight * h)

setHighlight

Parameters
hThe highlight. Ownership is taken.

Definition at line 63 of file qgsattributedialog.cpp.

◆ setMode()

void QgsAttributeDialog::setMode ( QgsAttributeEditorContext::Mode mode)

Toggles the form mode.

Parameters
modeform mode. For example, if set to QgsAttributeEditorContext::AddFeatureMode, the dialog will be editable even with an invalid feature and will add a new feature when the form is accepted.

Definition at line 152 of file qgsattributedialog.cpp.

◆ show

void QgsAttributeDialog::show ( )
slot

Show the dialog non-blocking. Reparents this dialog to be a child of the dialog form.

Definition at line 87 of file qgsattributedialog.cpp.

◆ showEvent()

void QgsAttributeDialog::showEvent ( QShowEvent * event)
override

Definition at line 95 of file qgsattributedialog.cpp.


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