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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/vector/qgsvectorlayertools.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsVectorLayerTools : QObject
{
%Docstring(signature="appended")
Methods in this class are used to handle basic operations on vector
layers. With an implementation of this class, parts of the application
can ask for an operation to be done and the implementation will then
take care of it.
Reimplement this class, if you need to have custom checks or GUI
elements in your application.
%End
%TypeHeaderCode
#include "qgsvectorlayertools.h"
%End
public:
QgsVectorLayerTools();
virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature /Out/ = 0, QWidget *parentWidget = 0, bool showModal = true, bool hideParent = false ) const;
%Docstring
This method should/will be called, whenever a new feature will be added
to the layer
:param layer: The layer to which the feature should be added
:param defaultValues: Default values for the feature to add
:param defaultGeometry: A default geometry to add to the feature
:param parentWidget: The widget calling this function to be passed to
the used dialog
:param showModal: If the used dialog should be modal or not
:param hideParent: If the parent widget should be hidden, when the used
dialog is opened
:return: - ``True`` in case of success, ``False`` if the operation
failed/was aborted
- feature: Updated feature after adding will be written back to
this
.. note::
addFeature or addFeatureV2 must be overwritten when implementing a class inheriting from QgsVectorLayerTools
%End
virtual bool addFeatureV2( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature /Out/ = 0, const QgsVectorLayerToolsContext &context = QgsVectorLayerToolsContext() ) const;
%Docstring
This method should/will be called, whenever a new feature will be added
to the layer
:param layer: The layer to which the feature should be added
:param defaultValues: Default values for the feature to add
:param defaultGeometry: A default geometry to add to the feature
:param context: A context object to be used for e.g. to calculate
feature expression-based values (since QGIS 3.38)
:return: - ``True`` in case of success, ``False`` if the operation
failed/was aborted
- feature: Updated feature after adding will be written back to
this
.. note::
addFeature or addFeatureV2 must be overwritten when implementing a class inheriting from QgsVectorLayerTools
.. versionadded:: 3.38
%End
virtual bool startEditing( QgsVectorLayer *layer ) const = 0;
%Docstring
This will be called, whenever a vector layer should be switched to edit
mode. Check the providers capability to edit in here. If successful
layer->:py:func:`~QgsVectorLayerTools.startEditing` will be called and
``True`` returned.
:param layer: The layer on which to start an edit session
:return: ``True``, if the editing session was started
%End
virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0;
%Docstring
Will be called, when an editing session is ended and the features should
be committed. Appropriate dialogs should be shown like
:param layer: The layer to commit
:param allowCancel: ``True`` if a cancel button should be offered
:return: ``True`` if successful
%End
virtual bool saveEdits( QgsVectorLayer *layer ) const = 0;
%Docstring
Should be called, when the features should be committed but the editing
session is not ended.
:param layer: The layer to commit
:return: ``True`` if successful
%End
virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request /In,Out/, double dx = 0, double dy = 0, QString *errorMsg /Out/ = 0, const bool topologicalEditing = false, QgsVectorLayer *topologicalLayer = 0, QString *childrenInfoMsg = 0 ) const;
%Docstring
Copy and move features with defined translation.
:param layer: The layer
:param request: The request for the features to be moved. It will be
assigned to a new feature request with the newly copied
features.
:param dx: The translation on x
:param dy: The translation on y
:param topologicalEditing: If ``True``, the function will perform
topological editing of the vertices of
``layer`` on ``layer`` and
``topologicalLayer``
:param topologicalLayer: The layer where vertices from the moved
features of ``layer`` will be added
:param childrenInfoMsg: If given, it will contain messages related to
the creation of child features
:return: - ``True`` if all features could be copied.
- errorMsg: If given, it will contain the error message
%End
bool forceSuppressFormPopup() const;
%Docstring
Returns force suppress form popup status.
:return: ``True`` if force suppress form popup is set.
.. versionadded:: 3.14
%End
void setForceSuppressFormPopup( bool forceSuppressFormPopup );
%Docstring
Sets force suppress form popup status to ``forceSuppressFormPopup``.
This flag will override the layer and general settings regarding the
automatic opening of the attribute form dialog when digitizing is
completed.
.. versionadded:: 3.14
%End
void setProject( QgsProject *project );
%Docstring
Sets the project to be used by operations when needed.
.. versionadded:: 3.34
%End
QgsProject *project() const;
%Docstring
Returns the project to be used by operations when needed.
.. versionadded:: 3.34
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/vector/qgsvectorlayertools.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|