From 90f7989f4d445874fbb1509898defb007a0c297c Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Thu, 7 Feb 2019 09:09:38 +0100 Subject: [PATCH 1/2] Move QGIS 3 todos to QGIS 4 --- .../qgscoordinatereferencesystem.sip.in | 14 +++++++------- .../core/auto_generated/qgsvectorlayertools.sip.in | 10 +++++----- src/core/geometry/qgsgeometry.h | 2 +- src/core/qgscoordinatereferencesystem.h | 14 +++++++------- src/core/qgspallabeling.h | 10 +++++----- src/core/qgsproject.h | 4 ++-- src/core/qgsvectorlayertools.h | 10 +++++----- src/gui/attributetable/qgsattributetablemodel.h | 2 +- .../editorwidgets/core/qgssearchwidgetwrapper.h | 2 +- src/gui/qgsattributeform.h | 6 +++--- src/gui/qgsmapcanvas.cpp | 2 +- src/gui/qgsmaptoolcapture.h | 8 ++++---- src/gui/raster/qgsrasterrendererwidget.h | 2 +- 13 files changed, 43 insertions(+), 43 deletions(-) diff --git a/python/core/auto_generated/qgscoordinatereferencesystem.sip.in b/python/core/auto_generated/qgscoordinatereferencesystem.sip.in index b72fa2bd318..3cd76e2df06 100644 --- a/python/core/auto_generated/qgscoordinatereferencesystem.sip.in +++ b/python/core/auto_generated/qgscoordinatereferencesystem.sip.in @@ -191,7 +191,7 @@ If no prefix is specified, WKT definition is assumed. :param definition: A String containing a coordinate reference system definition. .. seealso:: :py:func:`createFromString` - / // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix + / // TODO QGIS 4: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix %End explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId ); @@ -205,7 +205,7 @@ Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS :param id: The ID valid for the chosen CRS ID type :param type: One of the types described in CrsType - / // TODO QGIS 3: remove type and always use EPSG code + / // TODO QGIS 4: remove type and always use EPSG code %End QgsCoordinateReferenceSystem( const QgsCoordinateReferenceSystem &srs ); @@ -304,7 +304,7 @@ Sets this CRS by lookup of the given ID in the CRS database. We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile. - / // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg + / // TODO QGIS 4: remove type and always use EPSG code, rename to createFromEpsg %End bool createFromOgcWmsCrs( const QString &crs ); @@ -322,7 +322,7 @@ and refer to QGIS internal CRS IDs. this method uses an internal cache. Call invalidateCache() to clear the cache. .. seealso:: :py:func:`fromOgcWmsCrs` - / // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) + / // TODO QGIS 4: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) %End bool createFromSrid( long srid ); @@ -332,7 +332,7 @@ Sets this CRS by lookup of the given PostGIS SRID in the CRS database. :param srid: The PostGIS SRID for the desired spatial reference system. :return: True on success else false - / // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead + / // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead %End bool createFromWkt( const QString &wkt ); @@ -500,7 +500,7 @@ pieces of information about CRS. The ellipsoid and projection acronyms must be set as well as the proj4string! :return: long the SrsId of the matched CRS, zero if no match was found - / // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4) + / // TODO QGIS 4: seems completely obsolete now (only compares proj4 - already done in createFromProj4) %End bool operator==( const QgsCoordinateReferenceSystem &srs ) const; @@ -543,7 +543,7 @@ Returns the internal CRS ID, if available. Returns PostGIS SRID for the CRS. :return: the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0) - / // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead + / // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead %End QString authid() const; diff --git a/python/core/auto_generated/qgsvectorlayertools.sip.in b/python/core/auto_generated/qgsvectorlayertools.sip.in index 2e241fd6eef..8d00d80e901 100644 --- a/python/core/auto_generated/qgsvectorlayertools.sip.in +++ b/python/core/auto_generated/qgsvectorlayertools.sip.in @@ -38,7 +38,7 @@ This method should/will be called, whenever a new feature will be added to the l :return: - True in case of success, False if the operation failed/was aborted - feature: Updated feature after adding will be written back to this -TODO QGIS 3: remove const qualifier +TODO QGIS 4: remove const qualifier %End virtual bool startEditing( QgsVectorLayer *layer ) const = 0; @@ -51,7 +51,7 @@ If successful layer->startEditing() will be called and true returned. :return: True, if the editing session was started -TODO QGIS 3: remove const qualifier +TODO QGIS 4: remove const qualifier %End virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0; @@ -64,7 +64,7 @@ Appropriate dialogs should be shown like :return: True if successful -TODO QGIS 3: remove const qualifier +TODO QGIS 4: remove const qualifier %End virtual bool saveEdits( QgsVectorLayer *layer ) const = 0; @@ -75,7 +75,7 @@ Should be called, when the features should be committed but the editing session :return: True if successful -TODO QGIS 3: remove const qualifier +TODO QGIS 4: remove const qualifier %End virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request /In,Out/, double dx = 0, double dy = 0, QString *errorMsg /Out/ = 0 ) const; @@ -90,7 +90,7 @@ Copy and move features with defined translation. :return: - True if all features could be copied. - errorMsg: If given, it will contain the error message -TODO QGIS 3: remove const qualifier +TODO QGIS 4: remove const qualifier %End }; diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index 787801119bc..bece869a197 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -585,7 +585,7 @@ class CORE_EXPORT QgsGeometry * \param sqrDist will be set to the square distance between the closest vertex and the specified point * \returns closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative. */ - //TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex + //TODO QGIS 4.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex SIP_OUT, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT, double &sqrDist SIP_OUT ) const; /** diff --git a/src/core/qgscoordinatereferencesystem.h b/src/core/qgscoordinatereferencesystem.h index 7ccd4112e20..ebd7b952c35 100644 --- a/src/core/qgscoordinatereferencesystem.h +++ b/src/core/qgscoordinatereferencesystem.h @@ -223,7 +223,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * If no prefix is specified, WKT definition is assumed. * \param definition A String containing a coordinate reference system definition. * \see createFromString() - */ // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix + */ // TODO QGIS 4: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix explicit QgsCoordinateReferenceSystem( const QString &definition ); /** @@ -232,7 +232,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile. * \param id The ID valid for the chosen CRS ID type * \param type One of the types described in CrsType - */ // TODO QGIS 3: remove type and always use EPSG code + */ // TODO QGIS 4: remove type and always use EPSG code explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId ); //! Copy constructor @@ -310,7 +310,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * \returns True on success else false * \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code * wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile. - */ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg + */ // TODO QGIS 4: remove type and always use EPSG code, rename to createFromEpsg bool createFromId( long id, CrsType type = PostgisCrsId ); /** @@ -322,14 +322,14 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * \returns True on success else false * \note this method uses an internal cache. Call invalidateCache() to clear the cache. * \see fromOgcWmsCrs() - */ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) + */ // TODO QGIS 4: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) bool createFromOgcWmsCrs( const QString &crs ); /** * Sets this CRS by lookup of the given PostGIS SRID in the CRS database. * \param srid The PostGIS SRID for the desired spatial reference system. * \returns True on success else false - */ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead + */ // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead bool createFromSrid( long srid ); /** @@ -450,7 +450,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * pieces of information about CRS. * \note The ellipsoid and projection acronyms must be set as well as the proj4string! * \returns long the SrsId of the matched CRS, zero if no match was found - */ // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4) + */ // TODO QGIS 4: seems completely obsolete now (only compares proj4 - already done in createFromProj4) long findMatchingProj(); /** @@ -507,7 +507,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem /** * Returns PostGIS SRID for the CRS. * \returns the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0) - */ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead + */ // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead long postgisSrid() const; /** diff --git a/src/core/qgspallabeling.h b/src/core/qgspallabeling.h index 0678baf4c51..3a7807de8d2 100644 --- a/src/core/qgspallabeling.h +++ b/src/core/qgspallabeling.h @@ -132,7 +132,7 @@ class CORE_EXPORT QgsPalLayerSettings /** * Placement modes which determine how label candidates are generated for a feature. */ - //TODO QGIS 3.0 - move to QgsLabelingEngine + //TODO QGIS 4.0 - move to QgsLabelingEngine enum Placement { AroundPoint, //!< Arranges candidates in a circle around a point (or centroid of a polygon). Applies to point or polygon layers only. @@ -146,7 +146,7 @@ class CORE_EXPORT QgsPalLayerSettings }; //! Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode - //TODO QGIS 3.0 - move to QgsLabelingEngine + //TODO QGIS 4.0 - move to QgsLabelingEngine enum PredefinedPointPosition { TopLeft, //!< Label on top-left of point @@ -167,7 +167,7 @@ class CORE_EXPORT QgsPalLayerSettings * Behavior modifier for label offset and distance, only applies in some * label placement modes. */ - //TODO QGIS 3.0 - move to QgsLabelingEngine + //TODO QGIS 4.0 - move to QgsLabelingEngine enum OffsetType { FromPoint, //!< Offset distance applies from point geometry @@ -177,7 +177,7 @@ class CORE_EXPORT QgsPalLayerSettings /** * Line placement flags, which control how candidates are generated for a linear feature. */ - //TODO QGIS 3.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make + //TODO QGIS 4.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make //LinePlacementFlags type, and replace use of pal::LineArrangementFlag enum LinePlacementFlags { @@ -233,7 +233,7 @@ class CORE_EXPORT QgsPalLayerSettings * Valid obstacle types, which affect how features within the layer will act as obstacles * for labels. */ - //TODO QGIS 3.0 - Move to QgsLabelingEngine + //TODO QGIS 4.0 - Move to QgsLabelingEngine enum ObstacleType { PolygonInterior, /*!< avoid placing labels over interior of polygon (prefer placing labels totally diff --git a/src/core/qgsproject.h b/src/core/qgsproject.h index a9fb1ca6ae1..82466e331b7 100644 --- a/src/core/qgsproject.h +++ b/src/core/qgsproject.h @@ -859,7 +859,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera * \see removeMapLayer() * \see removeAllMapLayers() */ - //TODO QGIS 3.0 - add PyName alias to avoid list type conversion error + //TODO QGIS 4.0 - add PyName alias to avoid list type conversion error void removeMapLayers( const QList &layers ); /** @@ -1285,7 +1285,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera * layerWillBeRemoved() signals will still be emitted following this signal. * You can use this signal to do easy (and fast) cleanup. */ - //TODO QGIS 3.0 - rename to past tense + //TODO QGIS 4.0 - rename to past tense void removeAll(); /** diff --git a/src/core/qgsvectorlayertools.h b/src/core/qgsvectorlayertools.h index 3a26520aeb0..fb376d97731 100644 --- a/src/core/qgsvectorlayertools.h +++ b/src/core/qgsvectorlayertools.h @@ -52,7 +52,7 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param feature Updated feature after adding will be written back to this * \returns True in case of success, False if the operation failed/was aborted * - * TODO QGIS 3: remove const qualifier + * TODO QGIS 4: remove const qualifier */ virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature SIP_OUT = nullptr ) const = 0; @@ -65,7 +65,7 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * * \returns True, if the editing session was started * - * TODO QGIS 3: remove const qualifier + * TODO QGIS 4: remove const qualifier */ virtual bool startEditing( QgsVectorLayer *layer ) const = 0; @@ -77,7 +77,7 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param allowCancel True if a cancel button should be offered * \returns True if successful * - * TODO QGIS 3: remove const qualifier + * TODO QGIS 4: remove const qualifier */ virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0; @@ -87,7 +87,7 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param layer The layer to commit * \returns True if successful * - * TODO QGIS 3: remove const qualifier + * TODO QGIS 4: remove const qualifier */ virtual bool saveEdits( QgsVectorLayer *layer ) const = 0; @@ -101,7 +101,7 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param errorMsg If given, it will contain the error message * \returns True if all features could be copied. * - * TODO QGIS 3: remove const qualifier + * TODO QGIS 4: remove const qualifier */ virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request SIP_INOUT, double dx = 0, double dy = 0, QString *errorMsg SIP_OUT = nullptr ) const; diff --git a/src/gui/attributetable/qgsattributetablemodel.h b/src/gui/attributetable/qgsattributetablemodel.h index 5e87139f00d..5f3cfdab189 100644 --- a/src/gui/attributetable/qgsattributetablemodel.h +++ b/src/gui/attributetable/qgsattributetablemodel.h @@ -224,7 +224,7 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel /** * Gets the the feature request */ - // TODO QGIS 3: return copy instead of reference + // TODO QGIS 4: return copy instead of reference const QgsFeatureRequest &request() const; /** diff --git a/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h b/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h index 586a50c488e..ffd93c921e9 100644 --- a/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h +++ b/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h @@ -179,7 +179,7 @@ class GUI_EXPORT QgsSearchWidgetWrapper : public QgsWidgetWrapper * \returns filter expression * \since QGIS 2.16 */ - // TODO QGIS 3.0 - make pure virtual + // TODO QGIS 4.0 - make pure virtual virtual QString createExpression( FilterFlags flags ) const { Q_UNUSED( flags ); return QStringLiteral( "TRUE" ); } /** diff --git a/src/gui/qgsattributeform.h b/src/gui/qgsattributeform.h index 9886304082e..42426540ac5 100644 --- a/src/gui/qgsattributeform.h +++ b/src/gui/qgsattributeform.h @@ -78,21 +78,21 @@ class GUI_EXPORT QgsAttributeForm : public QWidget * Hides the button box (OK/Cancel) and enables auto-commit * \note set Embed in QgsAttributeEditorContext in constructor instead */ - // TODO QGIS 3.0 - make private + // TODO QGIS 4.0 - make private void hideButtonBox(); /** * Shows the button box (OK/Cancel) and disables auto-commit * \note set Embed in QgsAttributeEditorContext in constructor instead */ - // TODO QGIS 3.0 - make private + // TODO QGIS 4.0 - make private void showButtonBox(); /** * Disconnects the button box (OK/Cancel) from the accept/resetValues slots * If this method is called, you have to create these connections from outside */ - // TODO QGIS 3.0 - make private + // TODO QGIS 4.0 - make private void disconnectButtonBox(); /** diff --git a/src/gui/qgsmapcanvas.cpp b/src/gui/qgsmapcanvas.cpp index 111e68d137f..e0f797cd3e8 100644 --- a/src/gui/qgsmapcanvas.cpp +++ b/src/gui/qgsmapcanvas.cpp @@ -76,7 +76,7 @@ email : sherman at mrcc.com * Deprecated to be deleted, stuff from here should be moved elsewhere. * \note not available in Python bindings */ -//TODO QGIS 3.0 - remove +//TODO QGIS 4.0 - remove class QgsMapCanvas::CanvasProperties { public: diff --git a/src/gui/qgsmaptoolcapture.h b/src/gui/qgsmaptoolcapture.h index 9df9a460706..a3952079c06 100644 --- a/src/gui/qgsmaptoolcapture.h +++ b/src/gui/qgsmaptoolcapture.h @@ -121,7 +121,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing * 1 if the current layer is null or not a vector layer * 2 if the transformation failed */ - // TODO QGIS 3.0 returns an enum instead of a magic constant + // TODO QGIS 4.0 returns an enum instead of a magic constant int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint ); /** @@ -134,7 +134,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing * 1 if the current layer is null or not a vector layer * 2 if the transformation failed */ - // TODO QGIS 3.0 returns an enum instead of a magic constant + // TODO QGIS 4.0 returns an enum instead of a magic constant int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint ); /** @@ -143,7 +143,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing * \returns 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure * \since QGIS 2.14 */ - // TODO QGIS 3.0 returns an enum instead of a magic constant + // TODO QGIS 4.0 returns an enum instead of a magic constant int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint ); /** @@ -175,7 +175,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing * Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates) * \returns 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed */ - // TODO QGIS 3.0 returns an enum instead of a magic constant + // TODO QGIS 4.0 returns an enum instead of a magic constant int addVertex( const QgsPointXY &point ); /** diff --git a/src/gui/raster/qgsrasterrendererwidget.h b/src/gui/raster/qgsrasterrendererwidget.h index 22348a7a7ee..75152e16ea2 100644 --- a/src/gui/raster/qgsrasterrendererwidget.h +++ b/src/gui/raster/qgsrasterrendererwidget.h @@ -39,7 +39,7 @@ class GUI_EXPORT QgsRasterRendererWidget: public QWidget public: - //TODO QGIS 3.0 - remove extent parameter, replace with map canvas parameter + //TODO QGIS 4.0 - remove extent parameter, replace with map canvas parameter QgsRasterRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent ) : mRasterLayer( layer ) , mExtent( extent ) From 2fb37042a53ec7a7a47c8bebbad61e9d2cd81268 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Thu, 7 Feb 2019 14:36:43 +0100 Subject: [PATCH 2/2] Fix TODO and docstrings --- .../geometry/qgsgeometry.sip.in | 15 +++++++ .../qgscoordinatereferencesystem.sip.in | 14 +++---- .../core/auto_generated/qgspallabeling.sip.in | 4 ++ python/core/auto_generated/qgsproject.sip.in | 24 +++++++++++ .../auto_generated/qgsvectorlayertools.sip.in | 15 +++---- .../qgsattributetablemodel.sip.in | 4 ++ .../auto_generated/qgsattributeform.sip.in | 21 ++++++++++ .../auto_generated/qgsmaptoolcapture.sip.in | 40 +++++++++++++++++++ src/core/geometry/qgsgeometry.h | 3 +- src/core/qgscoordinatereferencesystem.h | 28 +++++++++---- src/core/qgspallabeling.h | 16 +++++--- src/core/qgsproject.h | 6 ++- src/core/qgsvectorlayertools.h | 15 ++++--- .../attributetable/qgsattributetablemodel.h | 3 +- src/gui/qgsattributeform.h | 9 +++-- src/gui/qgsmaptoolcapture.h | 12 ++++-- 16 files changed, 183 insertions(+), 46 deletions(-) diff --git a/python/core/auto_generated/geometry/qgsgeometry.sip.in b/python/core/auto_generated/geometry/qgsgeometry.sip.in index 51fc32fd1b8..8db0eed83a7 100644 --- a/python/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/core/auto_generated/geometry/qgsgeometry.sip.in @@ -493,7 +493,22 @@ In case of error -1 will be returned. .. versionadded:: 3.0 %End + QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex /Out/, int &beforeVertex /Out/, int &afterVertex /Out/, double &sqrDist /Out/ ) const; +%Docstring +Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point +and the indices of the vertices before and after the closest vertex. + +:param point: point to search for +:param beforeVertex: will be set to the vertex index of the previous vertex from the closest one. Will be set to -1 if + not present. +:param afterVertex: will be set to the vertex index of the next vertex after the closest one. Will be set to -1 if + not present. +:param sqrDist: will be set to the square distance between the closest vertex and the specified point + +:return: - closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative. + - atVertex: will be set to the vertex index of the closest found vertex +%End double distanceToVertex( int vertex ) const; %Docstring diff --git a/python/core/auto_generated/qgscoordinatereferencesystem.sip.in b/python/core/auto_generated/qgscoordinatereferencesystem.sip.in index 3cd76e2df06..9236ef9f281 100644 --- a/python/core/auto_generated/qgscoordinatereferencesystem.sip.in +++ b/python/core/auto_generated/qgscoordinatereferencesystem.sip.in @@ -175,6 +175,7 @@ Constructs an invalid CRS object ~QgsCoordinateReferenceSystem(); + explicit QgsCoordinateReferenceSystem( const QString &definition ); %Docstring Constructs a CRS object from a string definition using createFromString() @@ -191,9 +192,9 @@ If no prefix is specified, WKT definition is assumed. :param definition: A String containing a coordinate reference system definition. .. seealso:: :py:func:`createFromString` - / // TODO QGIS 4: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix %End + explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId ); %Docstring Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS CRS ID. @@ -205,7 +206,6 @@ Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS :param id: The ID valid for the chosen CRS ID type :param type: One of the types described in CrsType - / // TODO QGIS 4: remove type and always use EPSG code %End QgsCoordinateReferenceSystem( const QgsCoordinateReferenceSystem &srs ); @@ -294,6 +294,7 @@ Creates a CRS from a specified QGIS SRS ID. %End + bool createFromId( long id, CrsType type = PostgisCrsId ); %Docstring Sets this CRS by lookup of the given ID in the CRS database. @@ -304,9 +305,9 @@ Sets this CRS by lookup of the given ID in the CRS database. We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile. - / // TODO QGIS 4: remove type and always use EPSG code, rename to createFromEpsg %End + bool createFromOgcWmsCrs( const QString &crs ); %Docstring Sets this CRS to the given OGC WMS-format Coordinate Reference Systems. @@ -322,9 +323,9 @@ and refer to QGIS internal CRS IDs. this method uses an internal cache. Call invalidateCache() to clear the cache. .. seealso:: :py:func:`fromOgcWmsCrs` - / // TODO QGIS 4: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) %End + bool createFromSrid( long srid ); %Docstring Sets this CRS by lookup of the given PostGIS SRID in the CRS database. @@ -332,7 +333,6 @@ Sets this CRS by lookup of the given PostGIS SRID in the CRS database. :param srid: The PostGIS SRID for the desired spatial reference system. :return: True on success else false - / // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead %End bool createFromWkt( const QString &wkt ); @@ -489,6 +489,7 @@ if that involves resorting to a hard coded default of geocs:wgs84. .. seealso:: :py:func:`setCustomCrsValidation` %End + long findMatchingProj(); %Docstring Walks the CRS databases (both system and user database) trying to match @@ -500,7 +501,6 @@ pieces of information about CRS. The ellipsoid and projection acronyms must be set as well as the proj4string! :return: long the SrsId of the matched CRS, zero if no match was found - / // TODO QGIS 4: seems completely obsolete now (only compares proj4 - already done in createFromProj4) %End bool operator==( const QgsCoordinateReferenceSystem &srs ) const; @@ -538,12 +538,12 @@ Returns the internal CRS ID, if available. :return: the internal sqlite3 srs.db primary key for this CRS %End + long postgisSrid() const; %Docstring Returns PostGIS SRID for the CRS. :return: the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0) - / // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead %End QString authid() const; diff --git a/python/core/auto_generated/qgspallabeling.sip.in b/python/core/auto_generated/qgspallabeling.sip.in index 423e30df377..47cf10ddff1 100644 --- a/python/core/auto_generated/qgspallabeling.sip.in +++ b/python/core/auto_generated/qgspallabeling.sip.in @@ -54,6 +54,7 @@ class QgsPalLayerSettings ~QgsPalLayerSettings(); + enum Placement { AroundPoint, @@ -82,12 +83,14 @@ class QgsPalLayerSettings BottomRight, }; + enum OffsetType { FromPoint, FromSymbolBounds, }; + enum LinePlacementFlags { OnLine, @@ -131,6 +134,7 @@ class QgsPalLayerSettings MultiFollowPlacement }; + enum ObstacleType { PolygonInterior, diff --git a/python/core/auto_generated/qgsproject.sip.in b/python/core/auto_generated/qgsproject.sip.in index 8456257ef07..076e94a5786 100644 --- a/python/core/auto_generated/qgsproject.sip.in +++ b/python/core/auto_generated/qgsproject.sip.in @@ -844,7 +844,24 @@ of any layers these layers will also be deleted. .. versionadded:: 1.8 %End + void removeMapLayers( const QList &layers ); +%Docstring +Remove a set of layers from the registry. + +The specified layers will be removed from the registry. If the registry has ownership +of any layers these layers will also be deleted. + +:param layers: A list of layers to remove. Null pointers are ignored. + +.. note:: + + As a side-effect the QgsProject instance is marked dirty. + +.. seealso:: :py:func:`removeMapLayer` + +.. seealso:: :py:func:`removeAllMapLayers` +%End void removeMapLayer( const QString &layerId ); %Docstring @@ -1323,7 +1340,14 @@ Emitted after a layer was removed from the registry. .. seealso:: :py:func:`layerWillBeRemoved` %End + void removeAll(); +%Docstring +Emitted when all layers are removed, before layersWillBeRemoved() and +layerWillBeRemoved() signals are emitted. The layersWillBeRemoved() and +layerWillBeRemoved() signals will still be emitted following this signal. +You can use this signal to do easy (and fast) cleanup. +%End void layersAdded( const QList &layers ); %Docstring diff --git a/python/core/auto_generated/qgsvectorlayertools.sip.in b/python/core/auto_generated/qgsvectorlayertools.sip.in index 8d00d80e901..4136ec2adae 100644 --- a/python/core/auto_generated/qgsvectorlayertools.sip.in +++ b/python/core/auto_generated/qgsvectorlayertools.sip.in @@ -27,6 +27,7 @@ in your application. public: QgsVectorLayerTools(); + virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature /Out/ = 0 ) const = 0; %Docstring This method should/will be called, whenever a new feature will be added to the layer @@ -37,10 +38,9 @@ This method should/will be called, whenever a new feature will be added to the l :return: - True in case of success, False if the operation failed/was aborted - feature: Updated feature after adding will be written back to this - -TODO QGIS 4: remove const qualifier %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 @@ -50,10 +50,9 @@ If successful layer->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 - -TODO QGIS 4: remove const qualifier %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. @@ -63,10 +62,9 @@ Appropriate dialogs should be shown like :param allowCancel: True if a cancel button should be offered :return: True if successful - -TODO QGIS 4: remove const qualifier %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. @@ -74,10 +72,9 @@ Should be called, when the features should be committed but the editing session :param layer: The layer to commit :return: True if successful - -TODO QGIS 4: remove const qualifier %End + virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request /In,Out/, double dx = 0, double dy = 0, QString *errorMsg /Out/ = 0 ) const; %Docstring Copy and move features with defined translation. @@ -89,8 +86,6 @@ Copy and move features with defined translation. :return: - True if all features could be copied. - errorMsg: If given, it will contain the error message - -TODO QGIS 4: remove const qualifier %End }; diff --git a/python/gui/auto_generated/attributetable/qgsattributetablemodel.sip.in b/python/gui/auto_generated/attributetable/qgsattributetablemodel.sip.in index 50110a4c5dd..cefbd7c4b6e 100644 --- a/python/gui/auto_generated/attributetable/qgsattributetablemodel.sip.in +++ b/python/gui/auto_generated/attributetable/qgsattributetablemodel.sip.in @@ -215,7 +215,11 @@ to dynamically adjust it. :param request: The request to use to fill this table model. %End + const QgsFeatureRequest &request() const; +%Docstring +Gets the the feature request +%End void setEditorContext( const QgsAttributeEditorContext &context ); %Docstring diff --git a/python/gui/auto_generated/qgsattributeform.sip.in b/python/gui/auto_generated/qgsattributeform.sip.in index bdcec82a77f..6b0826ac38c 100644 --- a/python/gui/auto_generated/qgsattributeform.sip.in +++ b/python/gui/auto_generated/qgsattributeform.sip.in @@ -44,11 +44,32 @@ class QgsAttributeForm : QWidget const QgsFeature &feature(); + void hideButtonBox(); +%Docstring +Hides the button box (OK/Cancel) and enables auto-commit + +.. note:: + + set Embed in QgsAttributeEditorContext in constructor instead +%End + void showButtonBox(); +%Docstring +Shows the button box (OK/Cancel) and disables auto-commit + +.. note:: + + set Embed in QgsAttributeEditorContext in constructor instead +%End + void disconnectButtonBox(); +%Docstring +Disconnects the button box (OK/Cancel) from the accept/resetValues slots +If this method is called, you have to create these connections from outside +%End void addInterface( QgsAttributeFormInterface *iface /Transfer/ ); %Docstring diff --git a/python/gui/auto_generated/qgsmaptoolcapture.sip.in b/python/gui/auto_generated/qgsmaptoolcapture.sip.in index 7e2ef498aa6..f469a80c9d9 100644 --- a/python/gui/auto_generated/qgsmaptoolcapture.sip.in +++ b/python/gui/auto_generated/qgsmaptoolcapture.sip.in @@ -96,11 +96,45 @@ convenient method to clean members protected: + int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint ); +%Docstring +Converts a map point to layer coordinates + +:param mapPoint: the point in map coordinates +\param[in,out] layerPoint the point in layer coordinates + +:return: + 0 in case of success + 1 if the current layer is null or not a vector layer + 2 if the transformation failed +%End + int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint ); +%Docstring +Converts a point to map coordinates and layer coordinates + +:param p: the input point +\param[in,out] layerPoint the point in layer coordinates +\param[in,out] mapPoint the point in map coordinates + +:return: + 0 in case of success + 1 if the current layer is null or not a vector layer + 2 if the transformation failed +%End + int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint ); +%Docstring +Fetches the original point from the source layer if it has the same +CRS as the current layer. + +:return: 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure + +.. versionadded:: 2.14 +%End QgsPoint mapPoint( const QgsMapMouseEvent &e ) const; %Docstring @@ -129,7 +163,13 @@ WkbType of the current layer). .. versionadded:: 3.0 %End + int addVertex( const QgsPointXY &point ); +%Docstring +Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates) + +:return: 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed +%End int addVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &match ); %Docstring diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index bece869a197..3e357f799b6 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -573,6 +573,8 @@ class CORE_EXPORT QgsGeometry */ double hausdorffDistanceDensify( const QgsGeometry &geom, double densifyFraction ) const; + //TODO QGIS 4.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex + /** * Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point * and the indices of the vertices before and after the closest vertex. @@ -585,7 +587,6 @@ class CORE_EXPORT QgsGeometry * \param sqrDist will be set to the square distance between the closest vertex and the specified point * \returns closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative. */ - //TODO QGIS 4.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex SIP_OUT, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT, double &sqrDist SIP_OUT ) const; /** diff --git a/src/core/qgscoordinatereferencesystem.h b/src/core/qgscoordinatereferencesystem.h index ebd7b952c35..c9beaff10e3 100644 --- a/src/core/qgscoordinatereferencesystem.h +++ b/src/core/qgscoordinatereferencesystem.h @@ -210,6 +210,8 @@ class CORE_EXPORT QgsCoordinateReferenceSystem ~QgsCoordinateReferenceSystem(); + // TODO QGIS 4: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix + /** * Constructs a CRS object from a string definition using createFromString() * @@ -223,16 +225,18 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * If no prefix is specified, WKT definition is assumed. * \param definition A String containing a coordinate reference system definition. * \see createFromString() - */ // TODO QGIS 4: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix + */ explicit QgsCoordinateReferenceSystem( const QString &definition ); + // TODO QGIS 4: remove type and always use EPSG code + /** * Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS CRS ID. * \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code * wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile. * \param id The ID valid for the chosen CRS ID type * \param type One of the types described in CrsType - */ // TODO QGIS 4: remove type and always use EPSG code + */ explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId ); //! Copy constructor @@ -305,14 +309,18 @@ class CORE_EXPORT QgsCoordinateReferenceSystem // Misc helper functions ----------------------- + // TODO QGIS 4: remove type and always use EPSG code, rename to createFromEpsg + /** * Sets this CRS by lookup of the given ID in the CRS database. * \returns True on success else false * \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code * wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile. - */ // TODO QGIS 4: remove type and always use EPSG code, rename to createFromEpsg + */ bool createFromId( long id, CrsType type = PostgisCrsId ); + // TODO QGIS 4: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) + /** * Sets this CRS to the given OGC WMS-format Coordinate Reference Systems. * @@ -322,14 +330,16 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * \returns True on success else false * \note this method uses an internal cache. Call invalidateCache() to clear the cache. * \see fromOgcWmsCrs() - */ // TODO QGIS 4: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid()) + */ bool createFromOgcWmsCrs( const QString &crs ); + // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead + /** * Sets this CRS by lookup of the given PostGIS SRID in the CRS database. * \param srid The PostGIS SRID for the desired spatial reference system. * \returns True on success else false - */ // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead + */ bool createFromSrid( long srid ); /** @@ -444,13 +454,15 @@ class CORE_EXPORT QgsCoordinateReferenceSystem */ void validate(); + // TODO QGIS 4: seems completely obsolete now (only compares proj4 - already done in createFromProj4) + /** * Walks the CRS databases (both system and user database) trying to match * stored PROJ string to a database entry in order to fill in further * pieces of information about CRS. * \note The ellipsoid and projection acronyms must be set as well as the proj4string! * \returns long the SrsId of the matched CRS, zero if no match was found - */ // TODO QGIS 4: seems completely obsolete now (only compares proj4 - already done in createFromProj4) + */ long findMatchingProj(); /** @@ -504,10 +516,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem */ long srsid() const; + // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead + /** * Returns PostGIS SRID for the CRS. * \returns the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0) - */ // TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead + */ long postgisSrid() const; /** diff --git a/src/core/qgspallabeling.h b/src/core/qgspallabeling.h index 3a7807de8d2..6bbab52b6a1 100644 --- a/src/core/qgspallabeling.h +++ b/src/core/qgspallabeling.h @@ -129,10 +129,11 @@ class CORE_EXPORT QgsPalLayerSettings //! copy operator - only copies the permanent members QgsPalLayerSettings &operator=( const QgsPalLayerSettings &s ); + //TODO QGIS 4.0 - move to QgsLabelingEngine + /** * Placement modes which determine how label candidates are generated for a feature. */ - //TODO QGIS 4.0 - move to QgsLabelingEngine enum Placement { AroundPoint, //!< Arranges candidates in a circle around a point (or centroid of a polygon). Applies to point or polygon layers only. @@ -145,8 +146,8 @@ class CORE_EXPORT QgsPalLayerSettings PerimeterCurved, //! Arranges candidates following the curvature of a polygon's boundary. Applies to polygon layers only. }; - //! Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode //TODO QGIS 4.0 - move to QgsLabelingEngine + //! Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode enum PredefinedPointPosition { TopLeft, //!< Label on top-left of point @@ -163,22 +164,24 @@ class CORE_EXPORT QgsPalLayerSettings BottomRight, //!< Label on bottom right of point }; + //TODO QGIS 4.0 - move to QgsLabelingEngine + /** * Behavior modifier for label offset and distance, only applies in some * label placement modes. */ - //TODO QGIS 4.0 - move to QgsLabelingEngine enum OffsetType { FromPoint, //!< Offset distance applies from point geometry FromSymbolBounds, //!< Offset distance applies from rendered symbol bounds }; + //TODO QGIS 4.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make + //LinePlacementFlags type, and replace use of pal::LineArrangementFlag + /** * Line placement flags, which control how candidates are generated for a linear feature. */ - //TODO QGIS 4.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make - //LinePlacementFlags type, and replace use of pal::LineArrangementFlag enum LinePlacementFlags { OnLine = 1, //!< Labels can be placed directly over a line feature. @@ -229,11 +232,12 @@ class CORE_EXPORT QgsPalLayerSettings will be drawn with right alignment*/ }; + //TODO QGIS 4.0 - Move to QgsLabelingEngine + /** * Valid obstacle types, which affect how features within the layer will act as obstacles * for labels. */ - //TODO QGIS 4.0 - Move to QgsLabelingEngine enum ObstacleType { PolygonInterior, /*!< avoid placing labels over interior of polygon (prefer placing labels totally diff --git a/src/core/qgsproject.h b/src/core/qgsproject.h index 82466e331b7..9a51ce64587 100644 --- a/src/core/qgsproject.h +++ b/src/core/qgsproject.h @@ -846,6 +846,8 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera */ void removeMapLayers( const QStringList &layerIds ); + //TODO QGIS 4.0 - add PyName alias to avoid list type conversion error + /** * \brief * Remove a set of layers from the registry. @@ -859,7 +861,6 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera * \see removeMapLayer() * \see removeAllMapLayers() */ - //TODO QGIS 4.0 - add PyName alias to avoid list type conversion error void removeMapLayers( const QList &layers ); /** @@ -1279,13 +1280,14 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera */ void layerRemoved( const QString &layerId ); + //TODO QGIS 4.0 - rename to past tense + /** * Emitted when all layers are removed, before layersWillBeRemoved() and * layerWillBeRemoved() signals are emitted. The layersWillBeRemoved() and * layerWillBeRemoved() signals will still be emitted following this signal. * You can use this signal to do easy (and fast) cleanup. */ - //TODO QGIS 4.0 - rename to past tense void removeAll(); /** diff --git a/src/core/qgsvectorlayertools.h b/src/core/qgsvectorlayertools.h index fb376d97731..4b96d808e51 100644 --- a/src/core/qgsvectorlayertools.h +++ b/src/core/qgsvectorlayertools.h @@ -43,6 +43,8 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject public: QgsVectorLayerTools(); + // TODO QGIS 4: remove const qualifier + /** * This method should/will be called, whenever a new feature will be added to the layer * @@ -52,10 +54,11 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param feature Updated feature after adding will be written back to this * \returns True in case of success, False if the operation failed/was aborted * - * TODO QGIS 4: remove const qualifier */ virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature SIP_OUT = nullptr ) const = 0; + // TODO QGIS 4: remove const qualifier + /** * This will be called, whenever a vector layer should be switched to edit mode. Check the providers * capability to edit in here. @@ -65,10 +68,11 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * * \returns True, if the editing session was started * - * TODO QGIS 4: remove const qualifier */ virtual bool startEditing( QgsVectorLayer *layer ) const = 0; + // TODO QGIS 4: remove const qualifier + /** * Will be called, when an editing session is ended and the features should be committed. * Appropriate dialogs should be shown like @@ -77,20 +81,22 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param allowCancel True if a cancel button should be offered * \returns True if successful * - * TODO QGIS 4: remove const qualifier */ virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0; + // TODO QGIS 4: remove const qualifier + /** * Should be called, when the features should be committed but the editing session is not ended. * * \param layer The layer to commit * \returns True if successful * - * TODO QGIS 4: remove const qualifier */ virtual bool saveEdits( QgsVectorLayer *layer ) const = 0; + // TODO QGIS 4: remove const qualifier + /** * Copy and move features with defined translation. * @@ -101,7 +107,6 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject * \param errorMsg If given, it will contain the error message * \returns True if all features could be copied. * - * TODO QGIS 4: remove const qualifier */ virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request SIP_INOUT, double dx = 0, double dy = 0, QString *errorMsg SIP_OUT = nullptr ) const; diff --git a/src/gui/attributetable/qgsattributetablemodel.h b/src/gui/attributetable/qgsattributetablemodel.h index 5f3cfdab189..5077c16067f 100644 --- a/src/gui/attributetable/qgsattributetablemodel.h +++ b/src/gui/attributetable/qgsattributetablemodel.h @@ -221,10 +221,11 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel */ void setRequest( const QgsFeatureRequest &request ); + // TODO QGIS 4: return copy instead of reference + /** * Gets the the feature request */ - // TODO QGIS 4: return copy instead of reference const QgsFeatureRequest &request() const; /** diff --git a/src/gui/qgsattributeform.h b/src/gui/qgsattributeform.h index 42426540ac5..9db552a267a 100644 --- a/src/gui/qgsattributeform.h +++ b/src/gui/qgsattributeform.h @@ -74,25 +74,28 @@ class GUI_EXPORT QgsAttributeForm : public QWidget const QgsFeature &feature() { return mFeature; } + // TODO QGIS 4.0 - make private + /** * Hides the button box (OK/Cancel) and enables auto-commit * \note set Embed in QgsAttributeEditorContext in constructor instead */ - // TODO QGIS 4.0 - make private void hideButtonBox(); + // TODO QGIS 4.0 - make private + /** * Shows the button box (OK/Cancel) and disables auto-commit * \note set Embed in QgsAttributeEditorContext in constructor instead */ - // TODO QGIS 4.0 - make private void showButtonBox(); + // TODO QGIS 4.0 - make private + /** * Disconnects the button box (OK/Cancel) from the accept/resetValues slots * If this method is called, you have to create these connections from outside */ - // TODO QGIS 4.0 - make private void disconnectButtonBox(); /** diff --git a/src/gui/qgsmaptoolcapture.h b/src/gui/qgsmaptoolcapture.h index a3952079c06..a511d2f6a84 100644 --- a/src/gui/qgsmaptoolcapture.h +++ b/src/gui/qgsmaptoolcapture.h @@ -112,6 +112,8 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing protected: + // TODO QGIS 4.0 returns an enum instead of a magic constant + /** * Converts a map point to layer coordinates * \param mapPoint the point in map coordinates @@ -121,9 +123,10 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing * 1 if the current layer is null or not a vector layer * 2 if the transformation failed */ - // TODO QGIS 4.0 returns an enum instead of a magic constant int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint ); + // TODO QGIS 4.0 returns an enum instead of a magic constant + /** * Converts a point to map coordinates and layer coordinates * \param p the input point @@ -134,16 +137,16 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing * 1 if the current layer is null or not a vector layer * 2 if the transformation failed */ - // TODO QGIS 4.0 returns an enum instead of a magic constant int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint ); + // TODO QGIS 4.0 returns an enum instead of a magic constant + /** * Fetches the original point from the source layer if it has the same * CRS as the current layer. * \returns 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure * \since QGIS 2.14 */ - // TODO QGIS 4.0 returns an enum instead of a magic constant int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint ); /** @@ -171,11 +174,12 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing */ QgsPoint mapPoint( const QgsPointXY &point ) const; + // TODO QGIS 4.0 returns an enum instead of a magic constant + /** * Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates) * \returns 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed */ - // TODO QGIS 4.0 returns an enum instead of a magic constant int addVertex( const QgsPointXY &point ); /**