1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldmappingwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsFieldMappingWidget : QgsPanelWidget
{
%Docstring(signature="appended")
The :py:class:`QgsFieldMappingWidget` class creates a mapping from one
set of :py:class:`QgsFields` to another, for each set of "destination"
fields an expression defines how to obtain the values of the
"destination" fields.
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgsfieldmappingwidget.h"
%End
public:
explicit QgsFieldMappingWidget( QWidget *parent = 0, const QgsFields &sourceFields = QgsFields(), const QgsFields &destinationFields = QgsFields(), const QMap<QString, QString> &expressions = QMap<QString, QString>() );
%Docstring
Constructs a QgsFieldMappingWidget from a set of ``sourceFields`` and
``destinationFields``, initial values for the expressions can be
optionally specified through ``expressions`` which is a map from the
original field name to the corresponding expression. A ``parent`` object
can also be specified.
%End
void setDestinationEditable( bool editable );
%Docstring
Sets the destination fields editable state to ``editable``
%End
bool destinationEditable() const;
%Docstring
Returns ``True`` if the destination fields are editable in the model
%End
QgsFieldMappingModel *model() const;
%Docstring
Returns the underlying mapping model
%End
QList<QgsFieldMappingModel::Field> mapping() const;
%Docstring
Returns a list of Field objects representing the current status of the
underlying mapping model
%End
QMap<QString, QgsProperty> fieldPropertyMap() const;
%Docstring
Returns a map of destination field name to :py:class:`QgsProperty`
definition for field value, representing the current status of the
widget.
.. seealso:: :py:func:`setFieldPropertyMap`
%End
void setFieldPropertyMap( const QMap<QString, QgsProperty> &map );
%Docstring
Sets a map of destination field name to :py:class:`QgsProperty`
definition for field value.
.. seealso:: :py:func:`fieldPropertyMap`
%End
QItemSelectionModel *selectionModel();
%Docstring
Returns the selection model
%End
void setSourceFields( const QgsFields &sourceFields );
%Docstring
Set source fields of the underlying mapping model to ``sourceFields``
%End
void setSourceLayer( QgsVectorLayer *layer );
%Docstring
Sets a source ``layer`` to use when generating expression previews in
the widget.
.. versionadded:: 3.16
%End
QgsVectorLayer *sourceLayer();
%Docstring
Returns the source layer for use when generating expression previews.
Returned value may be ``None``.
.. versionadded:: 3.16
%End
void setDestinationFields( const QgsFields &destinationFields, const QMap<QString, QString> &expressions = QMap<QString, QString>() );
%Docstring
Set destination fields to ``destinationFields`` in the underlying model,
initial values for the expressions can be optionally specified through
``expressions`` which is a map from the original field name to the
corresponding expression.
%End
void scrollTo( const QModelIndex &index ) const;
%Docstring
Scroll the fields view to ``index``
%End
void registerExpressionContextGenerator( const QgsExpressionContextGenerator *generator );
%Docstring
Register an expression context ``generator`` class that will be used to
retrieve an expression context for the widget.
%End
signals:
void changed();
%Docstring
Emitted when the fields defined in the widget are changed.
%End
public slots:
void appendField( const QgsField &field, const QString &expression = QString() );
%Docstring
Appends a new ``field`` to the model, with an optional ``expression``
%End
bool removeSelectedFields();
%Docstring
Removes the currently selected field from the model
%End
bool moveSelectedFieldsUp();
%Docstring
Moves up currently selected field
%End
bool moveSelectedFieldsDown();
%Docstring
Moves down the currently selected field
%End
void invertSelection();
%Docstring
Invert the field selection state.
.. versionadded:: 3.32
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldmappingwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|