2017-05-23 14:36:52 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsattributeformeditorwidget.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
class QgsAttributeFormEditorWidget : QWidget
|
|
|
|
{
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
A widget consisting of both an editor widget and additional widgets for controlling the behavior
|
|
|
|
of the editor widget depending on a number of possible modes. For instance, if the parent attribute
|
|
|
|
form is in the multi edit mode, this widget will show both the editor widget and a tool button for
|
|
|
|
controlling the multi edit results.
|
|
|
|
.. versionadded:: 2.16
|
2016-03-08 14:11:33 +11:00
|
|
|
%End
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsattributeformeditorwidget.h"
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum Mode
|
|
|
|
{
|
2017-05-23 14:36:52 +02:00
|
|
|
DefaultMode,
|
|
|
|
MultiEditMode,
|
|
|
|
SearchMode,
|
2016-03-08 14:11:33 +11:00
|
|
|
};
|
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
explicit QgsAttributeFormEditorWidget( QgsEditorWidgetWrapper *editorWidget,
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsAttributeForm *form /TransferThis/ );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsAttributeFormEditorWidget.
|
|
|
|
\param editorWidget associated editor widget wrapper (for default/edit modes)
|
|
|
|
\param form parent attribute form
|
|
|
|
%End
|
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
~QgsAttributeFormEditorWidget();
|
|
|
|
|
2017-05-24 08:36:09 +02:00
|
|
|
void createSearchWidgetWrappers( const QString &widgetId, int fieldIdx,
|
|
|
|
const QVariantMap &config );
|
|
|
|
|
|
|
|
%Docstring
|
|
|
|
Creates the search widget wrappers for the widget used when the form is in
|
|
|
|
search mode.
|
|
|
|
\param widgetId id of the widget type to create a search wrapper for
|
|
|
|
\param fieldIdx index of field associated with widget
|
|
|
|
\param config configuration which should be used for the widget creation
|
|
|
|
\param context editor context (not available in Python bindings)
|
|
|
|
%End
|
2017-05-23 14:36:52 +02:00
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
void setMode( Mode mode );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the current mode for the widget. The widget will adapt its state and visible widgets to
|
|
|
|
reflect the updated mode. For example, showing multi edit tool buttons if the mode is set to MultiEditMode.
|
|
|
|
\param mode widget mode
|
|
|
|
.. seealso:: mode()
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
|
|
|
Mode mode() const;
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the current mode for the widget.
|
|
|
|
.. seealso:: setMode()
|
|
|
|
:rtype: Mode
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void initialize( const QVariant &initialValue, bool mixedValues = false );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Resets the widget to an initial value.
|
|
|
|
\param initialValue initial value to show in widget
|
|
|
|
\param mixedValues set to true to initially show the mixed values state
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
|
|
|
bool hasChanged() const;
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Returns true if the widget's value has been changed since it was initialized.
|
|
|
|
.. seealso:: initialize()
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
|
|
|
QVariant currentValue() const;
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the current value of the attached editor widget.
|
|
|
|
:rtype: QVariant
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2016-05-17 14:16:17 +10:00
|
|
|
QString currentFilterExpression() const;
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Creates an expression matching the current search filter value and
|
|
|
|
search properties represented in the widget.
|
|
|
|
.. versionadded:: 2.16
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2017-10-26 18:58:42 +02:00
|
|
|
void setConstraintStatus( const QString &constraint, const QString &description, const QString &err, QgsEditorWidgetWrapper::ConstraintResult result );
|
|
|
|
%Docstring
|
|
|
|
Set the constraint status for this widget.
|
|
|
|
%End
|
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void setIsMixed( bool mixed );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Sets whether the widget should be displayed in a "mixed values" mode.
|
|
|
|
\param mixed set to true to show in a mixed values state
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
|
|
|
void changesCommitted();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Called when field values have been committed;
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2016-05-17 14:16:17 +10:00
|
|
|
void resetSearch();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Resets the search/filter value of the widget.
|
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
signals:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void valueChanged( const QVariant &value );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
2017-10-05 11:51:04 +10:00
|
|
|
Emitted when the widget's value changes
|
|
|
|
\param value new widget value
|
2017-05-23 14:36:52 +02:00
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2016-05-17 14:16:17 +10:00
|
|
|
protected:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsSearchWidgetToolButton *searchWidgetToolButton();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Returns a pointer to the search widget tool button in the widget.
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
this method is in place for unit testing only, and is not considered
|
|
|
|
stable API
|
|
|
|
:rtype: QgsSearchWidgetToolButton
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setSearchWidgetWrapper( QgsSearchWidgetWrapper *wrapper );
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the search widget wrapper for the widget used when the form is in
|
|
|
|
search mode.
|
|
|
|
\param wrapper search widget wrapper.
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
the search widget wrapper should be created using searchWidgetFrame()
|
|
|
|
as its parent
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
this method is in place for unit testing only, and is not considered
|
|
|
|
stable AP
|
|
|
|
%End
|
2016-05-23 19:25:12 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QWidget *searchWidgetFrame();
|
2017-05-23 14:36:52 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the widget which should be used as a parent during construction
|
|
|
|
of the search widget wrapper.
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
this method is in place for unit testing only, and is not considered
|
|
|
|
stable AP
|
|
|
|
:rtype: QWidget
|
|
|
|
%End
|
2016-05-23 19:25:12 +10:00
|
|
|
|
2017-05-23 14:36:52 +02:00
|
|
|
QList< QgsSearchWidgetWrapper * > searchWidgetWrappers();
|
|
|
|
%Docstring
|
|
|
|
Returns the search widget wrapper used in this widget. The wrapper must
|
|
|
|
first be created using createSearchWidgetWrapper()
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
this method is in place for unit testing only, and is not considered
|
|
|
|
stable AP
|
|
|
|
:rtype: list of QgsSearchWidgetWrapper
|
|
|
|
%End
|
2016-05-23 19:25:12 +10:00
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
};
|
2017-05-23 14:36:52 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsattributeformeditorwidget.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|