|
@@ -10,6 +10,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%ModuleHeaderCode |
|
|
// fix to allow compilation with sip that for some reason |
|
|
// doesn't add this include to the file where the code from |
|
@@ -20,24 +21,38 @@ |
|
|
|
|
|
|
|
|
|
|
|
class QgsRelationEditorWidget : QgsCollapsibleGroupBox |
|
|
class QgsRelationEditorWidget : QgsRelationWidget |
|
|
{ |
|
|
%Docstring |
|
|
The default relation widget in QGIS. Successor of the now deprecated {:py:class:`QgsRelationEditorWidget`}. |
|
|
|
|
|
.. versionadded:: 3.18 |
|
|
%End |
|
|
|
|
|
%TypeHeaderCode |
|
|
#include "qgsrelationeditorwidget.h" |
|
|
%End |
|
|
%ConvertToSubClassCode |
|
|
if ( qobject_cast<QgsRelationEditorWidget *>( sipCpp ) ) |
|
|
sipType = sipType_QgsRelationEditorWidget; |
|
|
else |
|
|
sipType = NULL; |
|
|
%End |
|
|
public: |
|
|
|
|
|
enum Button |
|
|
{ |
|
|
Link, |
|
|
Unlink, |
|
|
SaveChildEdits, |
|
|
AddChildFeature, |
|
|
DuplicateChildFeature, |
|
|
DeleteChildFeature, |
|
|
ZoomToChildFeature, |
|
|
AllButtons |
|
|
}; |
|
|
typedef QFlags<QgsRelationEditorWidget::Button> Buttons; |
|
|
|
|
|
|
|
|
QgsRelationEditorWidget( QWidget *parent /TransferThis/ = 0 ); |
|
|
QgsRelationEditorWidget( const QVariantMap &config, QWidget *parent /TransferThis/ = 0 ); |
|
|
%Docstring |
|
|
Constructor |
|
|
|
|
|
:param config: widget configuration |
|
|
:param parent: parent widget |
|
|
%End |
|
|
|
|
@@ -49,27 +64,6 @@ Define the view mode for the dual view |
|
|
QgsDualView::ViewMode viewMode(); |
|
|
%Docstring |
|
|
Gets the view mode for the dual view |
|
|
%End |
|
|
|
|
|
void setRelationFeature( const QgsRelation &relation, const QgsFeature &feature ); |
|
|
%Docstring |
|
|
Sets the ``relation`` and the ``feature`` |
|
|
%End |
|
|
|
|
|
void setRelations( const QgsRelation &relation, const QgsRelation &nmrelation ); |
|
|
%Docstring |
|
|
Set the relation(s) for this widget |
|
|
If only one relation is set, it will act as a simple 1:N relation widget |
|
|
If both relations are set, it will act as an N:M relation widget |
|
|
inserting and deleting entries on the intermediate table as required. |
|
|
|
|
|
:param relation: Relation referencing the edited table |
|
|
:param nmrelation: Optional reference from the referencing table to a 3rd N:M table |
|
|
%End |
|
|
|
|
|
void setFeature( const QgsFeature &feature, bool update = true ); |
|
|
%Docstring |
|
|
Sets the ``feature`` being edited and updates the UI unless ``update`` is set to ``False`` |
|
|
%End |
|
|
|
|
|
void setEditorContext( const QgsAttributeEditorContext &context ); |
|
@@ -82,171 +76,42 @@ Sets the editor ``context`` |
|
|
the geometry of a referencing feature from this widget |
|
|
%End |
|
|
|
|
|
QgsAttributeEditorContext editorContext( ) const; |
|
|
%Docstring |
|
|
Returns the attribute editor context. |
|
|
|
|
|
.. versionadded:: 3.14 |
|
|
%End |
|
|
|
|
|
QgsIFeatureSelectionManager *featureSelectionManager(); |
|
|
%Docstring |
|
|
The feature selection manager is responsible for the selected features |
|
|
which are currently being edited. |
|
|
%End |
|
|
|
|
|
bool showLabel() const; |
|
|
%Docstring |
|
|
Defines if a title label should be shown for this widget. |
|
|
|
|
|
.. versionadded:: 2.18 |
|
|
%End |
|
|
|
|
|
void setShowLabel( bool showLabel ); |
|
|
%Docstring |
|
|
Defines if a title label should be shown for this widget. |
|
|
|
|
|
.. versionadded:: 2.18 |
|
|
%End |
|
|
|
|
|
bool showLinkButton() const /Deprecated/; |
|
|
%Docstring |
|
|
Determines if the "link feature" button should be shown |
|
|
|
|
|
.. versionadded:: 2.18 |
|
|
|
|
|
.. deprecated:: QGIS 3.16 |
|
|
use visibleButtons() instead |
|
|
%End |
|
|
|
|
|
void setShowLinkButton( bool showLinkButton ) /Deprecated/; |
|
|
%Docstring |
|
|
Determines if the "link feature" button should be shown |
|
|
|
|
|
.. versionadded:: 2.18 |
|
|
|
|
|
.. deprecated:: QGIS 3.16 |
|
|
use setVisibleButtons() instead |
|
|
%End |
|
|
|
|
|
bool showUnlinkButton() const /Deprecated/; |
|
|
%Docstring |
|
|
Determines if the "unlink feature" button should be shown |
|
|
|
|
|
.. versionadded:: 2.18 |
|
|
|
|
|
.. deprecated:: QGIS 3.16 |
|
|
use visibleButtons() instead |
|
|
%End |
|
|
|
|
|
void setShowUnlinkButton( bool showUnlinkButton ) /Deprecated/; |
|
|
%Docstring |
|
|
Determines if the "unlink feature" button should be shown |
|
|
|
|
|
.. versionadded:: 2.18 |
|
|
|
|
|
.. deprecated:: QGIS 3.16 |
|
|
use setVisibleButtons() instead |
|
|
%End |
|
|
|
|
|
void setShowSaveChildEditsButton( bool showChildEdits ) /Deprecated/; |
|
|
%Docstring |
|
|
Determines if the "Save child layer edits" button should be shown |
|
|
|
|
|
.. versionadded:: 3.14 |
|
|
|
|
|
.. deprecated:: QGIS 3.16 |
|
|
use setVisibleButtons() instead |
|
|
%End |
|
|
|
|
|
bool showSaveChildEditsButton() const /Deprecated/; |
|
|
%Docstring |
|
|
Determines if the "Save child layer edits" button should be shown |
|
|
|
|
|
.. versionadded:: 3.14 |
|
|
|
|
|
.. deprecated:: QGIS 3.16 |
|
|
use visibleButtons() instead |
|
|
%End |
|
|
|
|
|
void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons ); |
|
|
void setVisibleButtons( const Buttons &buttons ); |
|
|
%Docstring |
|
|
Defines the buttons which are shown |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
%End |
|
|
|
|
|
QgsAttributeEditorRelation::Buttons visibleButtons() const; |
|
|
Buttons visibleButtons() const; |
|
|
%Docstring |
|
|
Returns the buttons which are shown |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
%End |
|
|
|
|
|
bool forceSuppressFormPopup() const; |
|
|
%Docstring |
|
|
Determines the force suppress form popup status that is configured for this widget |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
%End |
|
|
|
|
|
void setForceSuppressFormPopup( bool forceSuppressFormPopup ); |
|
|
%Docstring |
|
|
Sets force suppress form popup status with ``forceSuppressFormPopup`` |
|
|
configured for this widget |
|
|
virtual QVariantMap config() const; |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
%End |
|
|
|
|
|
QVariant nmRelationId() const; |
|
|
%Docstring |
|
|
Determines the relation id of the second relation involved in an N:M relation. |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
Returns the current configuration |
|
|
%End |
|
|
|
|
|
void setNmRelationId( const QVariant &nmRelationId = QVariant() ); |
|
|
%Docstring |
|
|
Sets ``nmRelationId`` for the relation id of the second relation involved in an N:M relation. |
|
|
If it's empty, then it's considered as a 1:M relationship. |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
%End |
|
|
virtual void setConfig( const QVariantMap &config ); |
|
|
|
|
|
QString label() const; |
|
|
%Docstring |
|
|
Determines the label of this element |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
Defines the current configuration |
|
|
%End |
|
|
|
|
|
void setLabel( const QString &label = QString() ); |
|
|
%Docstring |
|
|
Sets ``label`` for this element |
|
|
If it's empty it takes the relation id as label |
|
|
|
|
|
.. versionadded:: 3.16 |
|
|
%End |
|
|
virtual void setTitle( const QString &title ); |
|
|
|
|
|
QgsFeature feature() const; |
|
|
%Docstring |
|
|
Returns the widget's current feature |
|
|
|
|
|
.. versionadded:: 3.14 |
|
|
Sets the title of the root groupbox |
|
|
%End |
|
|
|
|
|
public slots: |
|
|
virtual void parentFormValueChanged( const QString &attribute, const QVariant &newValue ); |
|
|
|
|
|
void parentFormValueChanged( const QString &attribute, const QVariant &newValue ); |
|
|
%Docstring |
|
|
Called when an ``attribute`` value in the parent widget has changed to ``newValue`` |
|
|
|
|
|
.. versionadded:: 3.14 |
|
|
%End |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************ |
|
|
* This file has been generated automatically from * |
|
|
* * |
|
|