2017-05-23 14:36:52 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsattributeform.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
|
|
|
|
class QgsAttributeForm : QWidget
|
|
|
|
{
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
%TypeHeaderCode
|
2017-05-23 14:36:52 +02:00
|
|
|
#include "qgsattributeform.h"
|
2014-01-05 14:50:07 +01:00
|
|
|
%End
|
|
|
|
public:
|
2016-03-08 14:11:33 +11:00
|
|
|
|
|
|
|
enum Mode
|
|
|
|
{
|
2017-05-23 14:36:52 +02:00
|
|
|
SingleEditMode,
|
|
|
|
AddFeatureMode,
|
|
|
|
MultiEditMode,
|
|
|
|
SearchMode,
|
2017-11-01 21:14:34 +01:00
|
|
|
AggregateSearchMode,
|
2016-05-17 14:16:17 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
enum FilterType
|
|
|
|
{
|
2017-05-23 14:36:52 +02:00
|
|
|
ReplaceFilter,
|
|
|
|
FilterAnd,
|
|
|
|
FilterOr,
|
2016-03-08 14:11:33 +11:00
|
|
|
};
|
|
|
|
|
2017-05-24 08:36:09 +02:00
|
|
|
explicit QgsAttributeForm( QgsVectorLayer *vl,
|
|
|
|
const QgsFeature &feature = QgsFeature(),
|
|
|
|
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
|
|
|
|
QWidget *parent /TransferThis/ = 0 );
|
2014-01-05 14:50:07 +01:00
|
|
|
~QgsAttributeForm();
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
const QgsFeature &feature();
|
2014-01-05 14:50:07 +01:00
|
|
|
|
|
|
|
void hideButtonBox();
|
|
|
|
|
|
|
|
void showButtonBox();
|
|
|
|
|
2014-11-20 14:17:51 +01:00
|
|
|
void disconnectButtonBox();
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void addInterface( QgsAttributeFormInterface *iface /Transfer/ );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Takes ownership
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param iface:
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsVectorLayer *layer();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the layer for which this form is shown
|
|
|
|
|
|
|
|
:return: Layer
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
|
|
|
bool editable();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns if the form is currently in editable mode.
|
|
|
|
|
|
|
|
:return: Editable mode of this form
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
Mode mode() const;
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current mode of the form.
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setMode`
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
|
|
|
void setMode( Mode mode );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current mode of the form.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mode: form mode
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`mode`
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setEditCommandMessage( const QString &message );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the edit command message (Undo) that will be used when the dialog is accepted
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param message: The message
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool eventFilter( QObject *object, QEvent *event );
|
|
|
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Intercepts keypress on custom form (escape should not close it)
|
|
|
|
|
|
|
|
:param object: The object for which the event has been sent
|
|
|
|
:param event: The event which is being filtered
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:return: true if the event has been handled (key was ESC)
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setMultiEditFeatureIds( const QgsFeatureIds &fids );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets all feature IDs which are to be edited if the form is in multiedit mode
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param fids: feature ID list
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setMessageBar( QgsMessageBar *messageBar );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the message bar to display feedback from the form in. This is used in the search/filter
|
|
|
|
mode to display the count of selected features.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param messageBar: target message bar
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-06-09 14:04:45 +10:00
|
|
|
|
2017-11-01 21:14:34 +01:00
|
|
|
QString aggregateFilter() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
The aggregate filter is only useful if the form is in AggregateFilter mode.
|
|
|
|
In this case it will return a combined expression according to the chosen filters
|
|
|
|
on all attribute widgets.
|
|
|
|
|
2017-11-21 08:32:53 +01:00
|
|
|
.. versionadded:: 3.0
|
2017-11-01 21:14:34 +01:00
|
|
|
%End
|
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
signals:
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void attributeChanged( const QString &attribute, const QVariant &value );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Notifies about changes of attributes
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param attribute: The name of the attribute that changed.
|
|
|
|
:param value: The new value of the attribute.
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void featureSaved( const QgsFeature &feature );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted, when a feature is changed or added
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void filterExpressionSet( const QString &expression, QgsAttributeForm::FilterType type );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted when a filter expression is set using the form.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param expression: filter expression
|
|
|
|
:param type: filter type
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
|
|
|
void modeChanged( QgsAttributeForm::Mode mode );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the form changes mode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mode: new mode
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2016-06-09 14:04:45 +10:00
|
|
|
void closed();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the user selects the close option from the form's button bar.
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-06-09 14:04:45 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void zoomToFeatures( const QString &filter );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the user chooses to zoom to a filtered set of features.
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 3.0
|
2017-09-29 10:59:29 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void flashFeatures( const QString &filter );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the user chooses to flash a filtered set of features.
|
|
|
|
|
2017-09-29 10:59:29 +10:00
|
|
|
.. versionadded:: 3.0
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2016-12-15 20:47:58 +10:00
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
public slots:
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-07-06 21:27:37 +02:00
|
|
|
void changeAttribute( const QString &field, const QVariant &value, const QString &hintText = QString() );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Call this to change the content of a given attribute. Will update the editor(s) related to this field.
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param field: The field to change
|
|
|
|
:param value: The new value
|
|
|
|
:param hintText: A hint text for non existent joined features
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-11-20 14:17:51 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setFeature( const QgsFeature &feature );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Update all editors to correspond to a different feature.
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param feature: The feature which will be represented by the form
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-11-20 14:17:51 +01:00
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
bool save();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Save all the values from the editors to the layer.
|
|
|
|
|
|
|
|
:return: True if successful
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2014-11-20 14:17:51 +01:00
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
void resetValues();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets all values to the values of the current feature
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2015-11-10 17:08:27 +11:00
|
|
|
|
2016-05-17 14:16:17 +10:00
|
|
|
void resetSearch();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Resets the search/filter form values.
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2015-11-10 17:08:27 +11:00
|
|
|
void refreshFeature();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
reload current feature
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
|
|
|
|
2014-01-05 14:50:07 +01:00
|
|
|
};
|
2017-05-23 14:36:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsattributeform.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|