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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/processing/qgsprocessingaggregatewidgets.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAggregateMappingModel : QAbstractTableModel
{
%Docstring(signature="appended")
The :py:class:`QgsAggregateMappingModel` holds mapping information for
defining sets of aggregates of fields from a :py:class:`QgsFields`
object.
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgsprocessingaggregatewidgets.h"
%End
public:
enum class ColumnDataIndex
{
SourceExpression,
Aggregate,
Delimiter,
DestinationName,
DestinationType,
DestinationLength,
DestinationPrecision,
};
struct Aggregate
{
QString source;
QString aggregate;
QString delimiter;
QgsField field;
};
QgsAggregateMappingModel( const QgsFields &sourceFields = QgsFields(), QObject *parent = 0 );
%Docstring
Constructs a QgsAggregateMappingModel from a set of ``sourceFields``. A
``parent`` object can be also specified.
%End
QgsFields sourceFields() const;
%Docstring
Returns a list of source fields
%End
QList<QgsAggregateMappingModel::Aggregate> mapping() const;
%Docstring
Returns a list of Aggregate objects representing the current status of
the model
%End
void setMapping( const QList<QgsAggregateMappingModel::Aggregate> &mapping );
%Docstring
Sets the ``mapping`` to show in the model.
%End
void appendField( const QgsField &field, const QString &source = QString(), const QString &aggregate = QString() );
%Docstring
Appends a new ``field`` to the model, with an optional ``source`` and
``aggregate``
%End
bool removeField( const QModelIndex &index );
%Docstring
Removes the field at ``index`` from the model, returns ``True`` on
success
%End
bool moveUp( const QModelIndex &index );
%Docstring
Moves down the field at ``index``
%End
bool moveDown( const QModelIndex &index );
%Docstring
Moves up the field at ``index``
%End
void setSourceFields( const QgsFields &sourceFields );
%Docstring
Set source fields to ``sourceFields``
%End
QgsExpressionContextGenerator *contextGenerator() const;
%Docstring
Returns the context generator with the source fields
%End
void setBaseExpressionContextGenerator( const QgsExpressionContextGenerator *generator );
%Docstring
Sets the base expression context ``generator``, which will generate the
expression contexts for expression based widgets used by the model.
%End
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual bool setData( const QModelIndex &index, const QVariant &value, int role );
};
class QgsAggregateMappingWidget : QgsPanelWidget
{
%Docstring(signature="appended")
The :py:class:`QgsAggregateMappingWidget` class creates a mapping for
defining sets of aggregates of fields from a :py:class:`QgsFields`
object.
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgsprocessingaggregatewidgets.h"
%End
public:
explicit QgsAggregateMappingWidget( QWidget *parent = 0, const QgsFields &sourceFields = QgsFields() );
%Docstring
Constructs a QgsAggregateMappingWidget from a set of ``sourceFields``. A
``parent`` object can also be specified.
%End
QgsAggregateMappingModel *model() const;
%Docstring
Returns the underlying mapping model
%End
QList<QgsAggregateMappingModel::Aggregate> mapping() const;
%Docstring
Returns a list of Aggregate objects representing the current status of
the underlying mapping model
%End
void setMapping( const QList<QgsAggregateMappingModel::Aggregate> &mapping );
%Docstring
Sets the ``mapping`` to show in the model.
%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 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 aggregates defined in the widget are changed.
%End
public slots:
void appendField( const QgsField &field, const QString &source = QString(), const QString &aggregate = QString() );
%Docstring
Appends a new ``field`` to the model, with an optional ``source`` and
``aggregate``
%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 currently selected field
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/processing/qgsprocessingaggregatewidgets.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|