QGIS API Documentation  2.99.0-Master (f867b65)
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends | List of all members
QgsRelationReferenceWidget Class Reference

#include <qgsrelationreferencewidget.h>

Inheritance diagram for QgsRelationReferenceWidget:
Inheritance graph
[legend]

Public Types

enum  CanvasExtent { Fixed, Pan, Scale }
 

Public Slots

void deleteForeignKey ()
 unset the currently related feature More...
 
void mapIdentification ()
 activate the map tool to select a new related feature on the map More...
 
void openForm ()
 open the form of the related feature in a new dialog More...
 

Signals

void foreignKeyChanged (const QVariant &)
 

Public Member Functions

 QgsRelationReferenceWidget (QWidget *parent)
 
 ~QgsRelationReferenceWidget ()
 
bool allowAddFeatures () const
 Determines if a button for adding new features should be shown. More...
 
bool allowMapIdentification ()
 determines if the widge offers the possibility to select the related feature on the map (using a dedicated map tool) More...
 
bool chainFilters () const
 Determines if the filters are chained. More...
 
bool embedForm ()
 determines if the form of the related feature will be shown More...
 
QVariant foreignKey () const
 returns the related feature foreign key More...
 
bool openFormButtonVisible ()
 determines the open form button is visible in the widget More...
 
bool orderByValue ()
 If the widget will order the combobox entries by value. More...
 
bool readOnlySelector ()
 determines if the foreign key is shown in a combox box or a read-only line edit More...
 
QgsFeature referencedFeature () const
 return the related feature (from the referenced layer) if no feature is related, it returns an invalid feature More...
 
void setAllowAddFeatures (bool allowAddFeatures)
 Determines if a button for adding new features should be shown. More...
 
void setAllowMapIdentification (bool allowMapIdentification)
 
void setChainFilters (bool chainFilters)
 Set if filters are chained. More...
 
void setEditorContext (const QgsAttributeEditorContext &context, QgsMapCanvas *canvas, QgsMessageBar *messageBar)
 
void setEmbedForm (bool display)
 
void setFilterFields (const QStringList &filterFields)
 Set the fields for which filter comboboxes will be created. More...
 
void setForeignKey (const QVariant &value)
 this sets the related feature using from the foreign key More...
 
void setOpenFormButtonVisible (bool openFormButtonVisible)
 
void setOrderByValue (bool orderByValue)
 Set if the widget will order the combobox entries by value. More...
 
void setReadOnlySelector (bool readOnly)
 
void setRelation (const QgsRelation &relation, bool allowNullValue)
 
void setRelationEditable (bool editable)
 
void showIndeterminateState ()
 Sets the widget to display in an indeterminate "mixed value" state. More...
 

Protected Member Functions

void init ()
 
virtual void showEvent (QShowEvent *e) override
 

Properties

bool openFormButtonVisible
 

Friends

class TestQgsRelationReferenceWidget
 

Detailed Description

Definition at line 55 of file qgsrelationreferencewidget.h.

Member Enumeration Documentation

◆ CanvasExtent

Enumerator
Fixed 
Pan 
Scale 

Definition at line 72 of file qgsrelationreferencewidget.h.

Constructor & Destructor Documentation

◆ QgsRelationReferenceWidget()

QgsRelationReferenceWidget::QgsRelationReferenceWidget ( QWidget *  parent)
explicit

Definition at line 43 of file qgsrelationreferencewidget.cpp.

◆ ~QgsRelationReferenceWidget()

QgsRelationReferenceWidget::~QgsRelationReferenceWidget ( )

Definition at line 176 of file qgsrelationreferencewidget.cpp.

Member Function Documentation

◆ allowAddFeatures()

bool QgsRelationReferenceWidget::allowAddFeatures ( ) const

Determines if a button for adding new features should be shown.

Since
QGIS 2.16

Definition at line 758 of file qgsrelationreferencewidget.cpp.

◆ allowMapIdentification()

bool QgsRelationReferenceWidget::allowMapIdentification ( )
inline

determines if the widge offers the possibility to select the related feature on the map (using a dedicated map tool)

Definition at line 104 of file qgsrelationreferencewidget.h.

◆ chainFilters()

bool QgsRelationReferenceWidget::chainFilters ( ) const
inline

Determines if the filters are chained.

Returns
True if filters are chained

Definition at line 123 of file qgsrelationreferencewidget.h.

◆ deleteForeignKey

void QgsRelationReferenceWidget::deleteForeignKey ( )
slot

unset the currently related feature

Definition at line 314 of file qgsrelationreferencewidget.cpp.

◆ embedForm()

bool QgsRelationReferenceWidget::embedForm ( )
inline

determines if the form of the related feature will be shown

Definition at line 96 of file qgsrelationreferencewidget.h.

◆ foreignKey()

QVariant QgsRelationReferenceWidget::foreignKey ( ) const

returns the related feature foreign key

Definition at line 377 of file qgsrelationreferencewidget.cpp.

◆ foreignKeyChanged

void QgsRelationReferenceWidget::foreignKeyChanged ( const QVariant &  )
signal

◆ init()

void QgsRelationReferenceWidget::init ( )
protected

Definition at line 469 of file qgsrelationreferencewidget.cpp.

◆ mapIdentification

void QgsRelationReferenceWidget::mapIdentification ( )
slot

activate the map tool to select a new related feature on the map

Definition at line 707 of file qgsrelationreferencewidget.cpp.

◆ openForm

void QgsRelationReferenceWidget::openForm ( )
slot

open the form of the related feature in a new dialog

Definition at line 622 of file qgsrelationreferencewidget.cpp.

◆ openFormButtonVisible()

bool QgsRelationReferenceWidget::openFormButtonVisible ( )
inline

determines the open form button is visible in the widget

Definition at line 115 of file qgsrelationreferencewidget.h.

◆ orderByValue()

bool QgsRelationReferenceWidget::orderByValue ( )
inline

If the widget will order the combobox entries by value.

Definition at line 108 of file qgsrelationreferencewidget.h.

◆ readOnlySelector()

bool QgsRelationReferenceWidget::readOnlySelector ( )
inline

determines if the foreign key is shown in a combox box or a read-only line edit

Definition at line 100 of file qgsrelationreferencewidget.h.

◆ referencedFeature()

QgsFeature QgsRelationReferenceWidget::referencedFeature ( ) const

return the related feature (from the referenced layer) if no feature is related, it returns an invalid feature

Definition at line 344 of file qgsrelationreferencewidget.cpp.

◆ setAllowAddFeatures()

void QgsRelationReferenceWidget::setAllowAddFeatures ( bool  allowAddFeatures)

Determines if a button for adding new features should be shown.

Since
QGIS 2.16

Definition at line 763 of file qgsrelationreferencewidget.cpp.

◆ setAllowMapIdentification()

void QgsRelationReferenceWidget::setAllowMapIdentification ( bool  allowMapIdentification)

Definition at line 432 of file qgsrelationreferencewidget.cpp.

◆ setChainFilters()

void QgsRelationReferenceWidget::setChainFilters ( bool  chainFilters)

Set if filters are chained.

Chained filters restrict the option of subsequent filters based on the selection of a previous filter.

Parameters
chainFiltersIf chaining should be enabled

Definition at line 455 of file qgsrelationreferencewidget.cpp.

◆ setEditorContext()

void QgsRelationReferenceWidget::setEditorContext ( const QgsAttributeEditorContext context,
QgsMapCanvas canvas,
QgsMessageBar messageBar 
)

Definition at line 400 of file qgsrelationreferencewidget.cpp.

◆ setEmbedForm()

void QgsRelationReferenceWidget::setEmbedForm ( bool  display)

Definition at line 412 of file qgsrelationreferencewidget.cpp.

◆ setFilterFields()

void QgsRelationReferenceWidget::setFilterFields ( const QStringList &  filterFields)

Set the fields for which filter comboboxes will be created.

Definition at line 444 of file qgsrelationreferencewidget.cpp.

◆ setForeignKey()

void QgsRelationReferenceWidget::setForeignKey ( const QVariant &  value)

this sets the related feature using from the foreign key

Definition at line 238 of file qgsrelationreferencewidget.cpp.

◆ setOpenFormButtonVisible()

void QgsRelationReferenceWidget::setOpenFormButtonVisible ( bool  openFormButtonVisible)

Definition at line 449 of file qgsrelationreferencewidget.cpp.

◆ setOrderByValue()

void QgsRelationReferenceWidget::setOrderByValue ( bool  orderByValue)

Set if the widget will order the combobox entries by value.

Definition at line 439 of file qgsrelationreferencewidget.cpp.

◆ setReadOnlySelector()

void QgsRelationReferenceWidget::setReadOnlySelector ( bool  readOnly)

Definition at line 424 of file qgsrelationreferencewidget.cpp.

◆ setRelation()

void QgsRelationReferenceWidget::setRelation ( const QgsRelation relation,
bool  allowNullValue 
)

Definition at line 184 of file qgsrelationreferencewidget.cpp.

◆ setRelationEditable()

void QgsRelationReferenceWidget::setRelationEditable ( bool  editable)

Definition at line 225 of file qgsrelationreferencewidget.cpp.

◆ showEvent()

void QgsRelationReferenceWidget::showEvent ( QShowEvent *  e)
overrideprotectedvirtual

Definition at line 460 of file qgsrelationreferencewidget.cpp.

◆ showIndeterminateState()

void QgsRelationReferenceWidget::showIndeterminateState ( )

Sets the widget to display in an indeterminate "mixed value" state.

Since
QGIS 2.16

Definition at line 363 of file qgsrelationreferencewidget.cpp.

Friends And Related Function Documentation

◆ TestQgsRelationReferenceWidget

friend class TestQgsRelationReferenceWidget
friend

Definition at line 246 of file qgsrelationreferencewidget.h.

Property Documentation

◆ openFormButtonVisible

bool QgsRelationReferenceWidget::openFormButtonVisible
readwrite

Definition at line 68 of file qgsrelationreferencewidget.h.


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