QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
#include <qgsrelationreferencewidget.h>
Public Types | |
enum | CanvasExtent { Fixed , Pan , Scale } |
Public Slots | |
void | deleteForeignKeys () |
unset the currently related feature | |
void | mapIdentification () |
activate the map tool to select a new related feature on the map | |
void | openForm () |
open the form of the related feature in a new dialog | |
Signals | |
Q_DECL_DEPRECATED void | foreignKeyChanged (const QVariant &key) |
Emitted when the foreign key changed. | |
void | foreignKeysChanged (const QVariantList &keys) |
Emitted when the foreign keys changed. | |
Public Member Functions | |
QgsRelationReferenceWidget (QWidget *parent) | |
~QgsRelationReferenceWidget () override | |
bool | allowAddFeatures () const |
Determines if a button for adding new features should be shown. | |
bool | allowMapIdentification () |
determines if the widget offers the possibility to select the related feature on the map (using a dedicated map tool) | |
bool | chainFilters () const |
Determines if the filters are chained. | |
bool | embedForm () |
determines if the form of the related feature will be shown | |
int | fetchLimit () const |
Returns the limit of fetched features (0 means all features) | |
QString | filterExpression () const |
Returns the currently set filter expression. | |
Q_DECL_DEPRECATED QVariant | foreignKey () const |
returns the related feature foreign key | |
QVariantList | foreignKeys () const |
returns the related feature foreign key | |
bool | openFormButtonVisible () |
determines the open form button is visible in the widget | |
bool | readOnlySelector () |
determines if the drop-down is enabled | |
QgsFeature | referencedFeature () const |
Returns the related feature (from the referenced layer) if no feature is related, it returns an invalid feature. | |
QString | referencedLayerDataSource () const |
Returns the public data source of the referenced layer. | |
QString | referencedLayerId () const |
Returns the id of the referenced layer. | |
QString | referencedLayerName () const |
Returns the name of the referenced layer. | |
QString | referencedLayerProviderKey () const |
Returns the data provider key of the referenced layer. | |
QgsRelation | relation () const |
Returns the current relation, which might be invalid. | |
void | setAllowAddFeatures (bool allowAddFeatures) |
Determines if a button for adding new features should be shown. | |
void | setAllowMapIdentification (bool allowMapIdentification) |
void | setChainFilters (bool chainFilters) |
Set if filters are chained. | |
void | setEditorContext (const QgsAttributeEditorContext &context, QgsMapCanvas *canvas, QgsMessageBar *messageBar) |
Sets the editor context. | |
void | setEmbedForm (bool display) |
void | setFetchLimit (int fetchLimit) |
Set the limit of fetched features (0 means all features) | |
void | setFilterExpression (const QString &filterExpression) |
If not empty, will be used as filter expression. | |
void | setFilterFields (const QStringList &filterFields) |
Sets the fields for which filter comboboxes will be created. | |
Q_DECL_DEPRECATED void | setForeignKey (const QVariant &value) |
this sets the related feature using from the foreign key | |
void | setForeignKeys (const QVariantList &values) |
Sets the related feature using the foreign keys. | |
void | setFormFeature (const QgsFeature &formFeature) |
Set the current form feature (from the referencing layer) | |
void | setOpenFormButtonVisible (bool openFormButtonVisible) |
void | setReadOnlySelector (bool readOnly) |
void | setReferencedLayerDataSource (const QString &referencedLayerDataSource) |
Set the public data source of the referenced layer to referencedLayerDataSource. | |
void | setReferencedLayerId (const QString &referencedLayerId) |
Set the id of the referenced layer to referencedLayerId. | |
void | setReferencedLayerName (const QString &referencedLayerName) |
Set the name of the referenced layer to referencedLayerName. | |
void | setReferencedLayerProviderKey (const QString &referencedLayerProviderKey) |
Set the data provider key of the referenced layer to referencedLayerProviderKey. | |
void | setRelation (const QgsRelation &relation, bool allowNullValue) |
void | setRelationEditable (bool editable) |
void | showIndeterminateState () |
Sets the widget to display in an indeterminate "mixed value" state. | |
Protected Member Functions | |
void | init () |
void | showEvent (QShowEvent *e) override |
Properties | |
bool | openFormButtonVisible |
Friends | |
class | TestQgsRelationReferenceWidget |
Definition at line 57 of file qgsrelationreferencewidget.h.
Enumerator | |
---|---|
Fixed | |
Pan | |
Scale |
Definition at line 74 of file qgsrelationreferencewidget.h.
|
explicit |
Definition at line 57 of file qgsrelationreferencewidget.cpp.
|
override |
Definition at line 157 of file qgsrelationreferencewidget.cpp.
bool QgsRelationReferenceWidget::allowAddFeatures | ( | ) | const |
Determines if a button for adding new features should be shown.
Definition at line 649 of file qgsrelationreferencewidget.cpp.
|
inline |
determines if the widget offers the possibility to select the related feature on the map (using a dedicated map tool)
Definition at line 131 of file qgsrelationreferencewidget.h.
|
inline |
Determines if the filters are chained.
true
if filters are chained Definition at line 146 of file qgsrelationreferencewidget.h.
|
slot |
unset the currently related feature
Definition at line 279 of file qgsrelationreferencewidget.cpp.
|
inline |
determines if the form of the related feature will be shown
Definition at line 123 of file qgsrelationreferencewidget.h.
|
inline |
Returns the limit of fetched features (0 means all features)
Definition at line 255 of file qgsrelationreferencewidget.h.
|
inline |
Returns the currently set filter expression.
Definition at line 159 of file qgsrelationreferencewidget.h.
QVariant QgsRelationReferenceWidget::foreignKey | ( | ) | const |
returns the related feature foreign key
Definition at line 313 of file qgsrelationreferencewidget.cpp.
|
signal |
Emitted when the foreign key changed.
QVariantList QgsRelationReferenceWidget::foreignKeys | ( | ) | const |
returns the related feature foreign key
Returns the related feature foreign keys
Definition at line 322 of file qgsrelationreferencewidget.cpp.
|
signal |
Emitted when the foreign keys changed.
|
protected |
Definition at line 400 of file qgsrelationreferencewidget.cpp.
|
slot |
activate the map tool to select a new related feature on the map
Definition at line 598 of file qgsrelationreferencewidget.cpp.
|
slot |
open the form of the related feature in a new dialog
Definition at line 523 of file qgsrelationreferencewidget.cpp.
|
inline |
determines the open form button is visible in the widget
Definition at line 138 of file qgsrelationreferencewidget.h.
|
inline |
determines if the drop-down is enabled
Definition at line 127 of file qgsrelationreferencewidget.h.
QgsFeature QgsRelationReferenceWidget::referencedFeature | ( | ) | const |
Returns the related feature (from the referenced layer) if no feature is related, it returns an invalid feature.
Definition at line 296 of file qgsrelationreferencewidget.cpp.
QString QgsRelationReferenceWidget::referencedLayerDataSource | ( | ) | const |
Returns the public data source of the referenced layer.
Definition at line 998 of file qgsrelationreferencewidget.cpp.
QString QgsRelationReferenceWidget::referencedLayerId | ( | ) | const |
Returns the id of the referenced layer.
Definition at line 978 of file qgsrelationreferencewidget.cpp.
QString QgsRelationReferenceWidget::referencedLayerName | ( | ) | const |
Returns the name of the referenced layer.
Definition at line 968 of file qgsrelationreferencewidget.cpp.
QString QgsRelationReferenceWidget::referencedLayerProviderKey | ( | ) | const |
Returns the data provider key of the referenced layer.
Definition at line 988 of file qgsrelationreferencewidget.cpp.
QgsRelation QgsRelationReferenceWidget::relation | ( | ) | const |
Returns the current relation, which might be invalid.
Definition at line 660 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setAllowAddFeatures | ( | bool | allowAddFeatures | ) |
Determines if a button for adding new features should be shown.
Definition at line 654 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setAllowMapIdentification | ( | bool | allowMapIdentification | ) |
Definition at line 363 of file qgsrelationreferencewidget.cpp.
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.
chainFilters | If chaining should be enabled |
Definition at line 381 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setEditorContext | ( | const QgsAttributeEditorContext & | context, |
QgsMapCanvas * | canvas, | ||
QgsMessageBar * | messageBar | ||
) |
Sets the editor context.
Definition at line 327 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setEmbedForm | ( | bool | display | ) |
Definition at line 344 of file qgsrelationreferencewidget.cpp.
|
inline |
Set the limit of fetched features (0 means all features)
Definition at line 261 of file qgsrelationreferencewidget.h.
void QgsRelationReferenceWidget::setFilterExpression | ( | const QString & | filterExpression | ) |
If not empty, will be used as filter expression.
Only if this evaluates to true
, the value will be shown.
Definition at line 386 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setFilterFields | ( | const QStringList & | filterFields | ) |
Sets the fields for which filter comboboxes will be created.
Definition at line 370 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setForeignKey | ( | const QVariant & | value | ) |
this sets the related feature using from the foreign key
Definition at line 233 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setForeignKeys | ( | const QVariantList & | values | ) |
Sets the related feature using the foreign keys.
Definition at line 238 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setFormFeature | ( | const QgsFeature & | formFeature | ) |
Set the current form feature (from the referencing layer)
Definition at line 1009 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setOpenFormButtonVisible | ( | bool | openFormButtonVisible | ) |
Definition at line 375 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setReadOnlySelector | ( | bool | readOnly | ) |
Definition at line 356 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setReferencedLayerDataSource | ( | const QString & | referencedLayerDataSource | ) |
Set the public data source of the referenced layer to referencedLayerDataSource.
Definition at line 1003 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setReferencedLayerId | ( | const QString & | referencedLayerId | ) |
Set the id of the referenced layer to referencedLayerId.
Definition at line 983 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setReferencedLayerName | ( | const QString & | referencedLayerName | ) |
Set the name of the referenced layer to referencedLayerName.
Definition at line 973 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setReferencedLayerProviderKey | ( | const QString & | referencedLayerProviderKey | ) |
Set the data provider key of the referenced layer to referencedLayerProviderKey.
Definition at line 993 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setRelation | ( | const QgsRelation & | relation, |
bool | allowNullValue | ||
) |
Definition at line 163 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::setRelationEditable | ( | bool | editable | ) |
Definition at line 218 of file qgsrelationreferencewidget.cpp.
|
overrideprotected |
Definition at line 391 of file qgsrelationreferencewidget.cpp.
void QgsRelationReferenceWidget::showIndeterminateState | ( | ) |
Sets the widget to display in an indeterminate "mixed value" state.
Definition at line 306 of file qgsrelationreferencewidget.cpp.
|
friend |
Definition at line 373 of file qgsrelationreferencewidget.h.
|
readwrite |
Definition at line 70 of file qgsrelationreferencewidget.h.