Skip to content

Commit

Permalink
Field mapping widget
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Apr 3, 2020
1 parent c6621a9 commit e7621be
Show file tree
Hide file tree
Showing 7 changed files with 700 additions and 1 deletion.
101 changes: 101 additions & 0 deletions python/gui/auto_generated/qgsfieldmappingwidget.sip.in
@@ -0,0 +1,101 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldmappingwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsFieldMappingWidget : QWidget
{
%Docstring
The QgsFieldMappingWidget class allows to define a map from one set of 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(const QgsFields &sourceFields,
const QgsFields &destinationFields,
const QMap<QString, QgsExpression> &expressions = QMap<QString, QgsExpression>(),
QWidget *parent = 0);

QMap<QString, QgsExpression> expressions() const;

signals:

public:
};


class QgsFieldMappingModel: QAbstractTableModel
{
%Docstring
The QgsFieldMappingModel holds mapping information for mapping from one set of 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:

QgsFieldMappingModel(const QgsFields &sourceFields,
const QgsFields &destinationFields,
const QMap<QString, QgsExpression> &expressions = QMap<QString, QgsExpression>(),
QObject* parent = 0);

QgsExpressionContextGenerator* contextGenerator();

virtual int rowCount(const QModelIndex& parent) const;

virtual int columnCount(const QModelIndex& parent) const;

virtual QVariant data(const QModelIndex& index, int role) const;

virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;



public:
public:
virtual Qt::ItemFlags flags(const QModelIndex& index) const;

QgsFields sourceFields() const;

public:
virtual bool setData(const QModelIndex& index, const QVariant& value, int role);

};














/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfieldmappingwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -82,6 +82,7 @@
%Include auto_generated/qgsfeatureselectiondlg.sip
%Include auto_generated/qgsfieldcombobox.sip
%Include auto_generated/qgsfieldexpressionwidget.sip
%Include auto_generated/qgsfieldmappingwidget.sip
%Include auto_generated/qgsfieldvalidator.sip
%Include auto_generated/qgsfieldvalueslineedit.sip
%Include auto_generated/qgsfilecontentsourcelineedit.sip
Expand Down
4 changes: 3 additions & 1 deletion src/gui/CMakeLists.txt
Expand Up @@ -372,7 +372,6 @@ SET(QGIS_GUI_SRCS
qgsdataitemguiproviderregistry.cpp
qgsdatumtransformdialog.cpp
qgsdatasourceselectdialog.cpp
qgsnewdatabasetablenamewidget.cpp
qgsdetaileditemdata.cpp
qgsdetaileditemdelegate.cpp
qgsdetaileditemwidget.cpp
Expand All @@ -394,6 +393,7 @@ SET(QGIS_GUI_SRCS
qgsfeatureselectiondlg.cpp
qgsfieldcombobox.cpp
qgsfieldexpressionwidget.cpp
qgsfieldmappingwidget.cpp
qgsfeaturelistcombobox.cpp
qgsfieldvalidator.cpp
qgsfieldvalueslineedit.cpp
Expand Down Expand Up @@ -463,6 +463,7 @@ SET(QGIS_GUI_SRCS
qgsmasksourceselectionwidget.cpp
qgsnewauxiliarylayerdialog.cpp
qgsnewauxiliaryfielddialog.cpp
qgsnewdatabasetablenamewidget.cpp
qgsnewhttpconnection.cpp
qgsnewmemorylayerdialog.cpp
qgsnewnamedialog.cpp
Expand Down Expand Up @@ -615,6 +616,7 @@ SET(QGIS_GUI_HDRS
qgsfeatureselectiondlg.h
qgsfieldcombobox.h
qgsfieldexpressionwidget.h
qgsfieldmappingwidget.h
qgsfieldvalidator.h
qgsfieldvalueslineedit.h
qgsfilecontentsourcelineedit.h
Expand Down

0 comments on commit e7621be

Please sign in to comment.