From d3adc10ec33f695525e338b9afd3e13f895aa92f Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 21 Oct 2020 06:35:28 +1000 Subject: [PATCH] Move some todos so they don't sit between member doxygen and declaration Sipify doesn't handle this, and drops off the docstring from the python method --- .../qgscoordinatereferencesystem.sip.in | 2 +- python/core/auto_generated/qgsfeatureiterator.sip.in | 1 + python/core/auto_generated/qgsmessageoutput.sip.in | 1 + python/core/auto_generated/qgsproviderregistry.sip.in | 1 + .../auto_generated/raster/qgsrasterbandstats.sip.in | 1 + .../raster/qgsrasterdataprovider.sip.in | 4 ++++ .../editorwidgets/core/qgseditorwidgetwrapper.sip.in | 10 ++++++++++ .../editorwidgets/core/qgssearchwidgetwrapper.sip.in | 11 +++++++++++ python/gui/auto_generated/qgsmapcanvas.sip.in | 7 ++++++- src/core/providers/ogr/qgsogrprovider.h | 4 ---- src/core/qgscoordinatereferencesystem.h | 4 +++- src/core/qgsfeatureiterator.h | 3 ++- src/core/qgsmessageoutput.h | 3 ++- src/core/qgsproviderregistry.h | 3 ++- src/core/raster/qgsrasterbandstats.h | 3 ++- src/core/raster/qgsrasterdataprovider.h | 3 ++- src/core/raster/qgsrasteridentifyresult.h | 3 ++- src/gui/editorwidgets/core/qgseditorwidgetwrapper.h | 3 ++- src/gui/editorwidgets/core/qgssearchwidgetwrapper.h | 3 ++- src/gui/qgsmapcanvas.h | 7 ++----- 20 files changed, 57 insertions(+), 20 deletions(-) diff --git a/python/core/auto_generated/qgscoordinatereferencesystem.sip.in b/python/core/auto_generated/qgscoordinatereferencesystem.sip.in index 0b6b64a55ad..b4e59ff02cc 100644 --- a/python/core/auto_generated/qgscoordinatereferencesystem.sip.in +++ b/python/core/auto_generated/qgscoordinatereferencesystem.sip.in @@ -514,6 +514,7 @@ If no prefix is specified, WKT definition is assumed. :return: ``True`` on success else ``False`` %End + bool createFromUserInput( const QString &definition ); %Docstring Set up this CRS from various text formats. @@ -534,7 +535,6 @@ For more details on supported formats see OGRSpatialReference.SetFromUserInput() this function generates a WKT string using OSRSetFromUserInput() and passes it to :py:func:`~QgsCoordinateReferenceSystem.createFromWkt` function. - / // TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend %End static void setupESRIWktFix() /Deprecated/; diff --git a/python/core/auto_generated/qgsfeatureiterator.sip.in b/python/core/auto_generated/qgsfeatureiterator.sip.in index 0a6f65304e5..d6dadca4240 100644 --- a/python/core/auto_generated/qgsfeatureiterator.sip.in +++ b/python/core/auto_generated/qgsfeatureiterator.sip.in @@ -141,6 +141,7 @@ Will throw a QgsCsException if the rect cannot be transformed from the destinati + void ref(); %Docstring Add reference diff --git a/python/core/auto_generated/qgsmessageoutput.sip.in b/python/core/auto_generated/qgsmessageoutput.sip.in index 17a4cd44cf9..bcaf26825b2 100644 --- a/python/core/auto_generated/qgsmessageoutput.sip.in +++ b/python/core/auto_generated/qgsmessageoutput.sip.in @@ -63,6 +63,7 @@ Display the blocking message to the user. %End + static QgsMessageOutput *createMessageOutput(); %Docstring function that returns new class derived from QgsMessageOutput diff --git a/python/core/auto_generated/qgsproviderregistry.sip.in b/python/core/auto_generated/qgsproviderregistry.sip.in index be6f690542f..08dd9f41d3f 100644 --- a/python/core/auto_generated/qgsproviderregistry.sip.in +++ b/python/core/auto_generated/qgsproviderregistry.sip.in @@ -33,6 +33,7 @@ ogr and postgres. %End public: + enum WidgetMode { diff --git a/python/core/auto_generated/raster/qgsrasterbandstats.sip.in b/python/core/auto_generated/raster/qgsrasterbandstats.sip.in index d7f62a5963f..4fdb2f7d748 100644 --- a/python/core/auto_generated/raster/qgsrasterbandstats.sip.in +++ b/python/core/auto_generated/raster/qgsrasterbandstats.sip.in @@ -44,6 +44,7 @@ Compares region, size etc. not collected statistics int bandNumber; + qgssize elementCount; double maximumValue; diff --git a/python/core/auto_generated/raster/qgsrasterdataprovider.sip.in b/python/core/auto_generated/raster/qgsrasterdataprovider.sip.in index a98f1782929..bbf319df3c3 100644 --- a/python/core/auto_generated/raster/qgsrasterdataprovider.sip.in +++ b/python/core/auto_generated/raster/qgsrasterdataprovider.sip.in @@ -382,7 +382,11 @@ to overwrite data of the provider using :py:func:`~QgsRasterDataProvider.writeBl .. versionadded:: 3.0 %End + virtual bool write( void *data, int band, int width, int height, int xOffset, int yOffset ); +%Docstring +Writes into the provider datasource +%End bool writeBlock( QgsRasterBlock *block, int band, int xOffset = 0, int yOffset = 0 ); %Docstring diff --git a/python/gui/auto_generated/editorwidgets/core/qgseditorwidgetwrapper.sip.in b/python/gui/auto_generated/editorwidgets/core/qgseditorwidgetwrapper.sip.in index 53b4c70e583..7577e77249a 100644 --- a/python/gui/auto_generated/editorwidgets/core/qgseditorwidgetwrapper.sip.in +++ b/python/gui/auto_generated/editorwidgets/core/qgseditorwidgetwrapper.sip.in @@ -288,7 +288,17 @@ Is forwarded to the slot :py:func:`~QgsEditorWidgetWrapper.setValues` :param feature: The new feature %End + virtual void setValue( const QVariant &value ) /Deprecated/; +%Docstring +Is called, when the value of the widget needs to be changed. Update the widget representation +to reflect the new value. + +:param value: The new value of the attribute + +.. deprecated:: QGIS 3.10 + +%End void setValues( const QVariant &value, const QVariantList &additionalValues ); %Docstring diff --git a/python/gui/auto_generated/editorwidgets/core/qgssearchwidgetwrapper.sip.in b/python/gui/auto_generated/editorwidgets/core/qgssearchwidgetwrapper.sip.in index 4eac7f6cf30..dcca41193f2 100644 --- a/python/gui/auto_generated/editorwidgets/core/qgssearchwidgetwrapper.sip.in +++ b/python/gui/auto_generated/editorwidgets/core/qgssearchwidgetwrapper.sip.in @@ -161,7 +161,18 @@ If this is ``True``, then this search widget should take effect directly when its expression changes %End + virtual QString createExpression( FilterFlags flags ) const; +%Docstring +Creates a filter expression based on the current state of the search widget +and the specified filter flags. + +:param flags: filter flags + +:return: filter expression + +.. versionadded:: 2.16 +%End QString createFieldIdentifier() const; %Docstring diff --git a/python/gui/auto_generated/qgsmapcanvas.sip.in b/python/gui/auto_generated/qgsmapcanvas.sip.in index 81b35c74347..bee617280be 100644 --- a/python/gui/auto_generated/qgsmapcanvas.sip.in +++ b/python/gui/auto_generated/qgsmapcanvas.sip.in @@ -1016,9 +1016,14 @@ Emitted when canvas background color changes %End - void renderComplete( QPainter * ); %Docstring +Emitted when the canvas has rendered. +Passes a pointer to the painter on which the map was drawn. This is +useful for plugins that wish to draw on the map after it has been +rendered. Passing the painter allows plugins to work when the map is +being rendered onto a pixmap other than the mapCanvas own pixmap member. + - anything related to rendering progress is not visible outside of map canvas - additional drawing shall be done directly within the renderer job or independently as a map canvas item %End diff --git a/src/core/providers/ogr/qgsogrprovider.h b/src/core/providers/ogr/qgsogrprovider.h index 73fe02d20f5..630efbe2917 100644 --- a/src/core/providers/ogr/qgsogrprovider.h +++ b/src/core/providers/ogr/qgsogrprovider.h @@ -427,10 +427,6 @@ class CORE_EXPORT QgsOgrProviderUtils const QgsCoordinateReferenceSystem &srs, QString &errorMessage ); - /** - * TODO - * \since QGIS 3.10 - */ static bool deleteLayer( const QString &uri, QString &errCause ); //! Inject credentials into the dsName (if any) diff --git a/src/core/qgscoordinatereferencesystem.h b/src/core/qgscoordinatereferencesystem.h index 6ff399e0076..9fa28284060 100644 --- a/src/core/qgscoordinatereferencesystem.h +++ b/src/core/qgscoordinatereferencesystem.h @@ -480,6 +480,8 @@ class CORE_EXPORT QgsCoordinateReferenceSystem */ bool createFromString( const QString &definition ); + // TODO QGIS 4: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend + /** * Set up this CRS from various text formats. * @@ -494,7 +496,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem * \returns TRUE on success else FALSE * \note this function generates a WKT string using OSRSetFromUserInput() and * passes it to createFromWkt() function. - */ // TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend + */ bool createFromUserInput( const QString &definition ); /** diff --git a/src/core/qgsfeatureiterator.h b/src/core/qgsfeatureiterator.h index ab2c533339b..2d04b886ae6 100644 --- a/src/core/qgsfeatureiterator.h +++ b/src/core/qgsfeatureiterator.h @@ -164,9 +164,10 @@ class CORE_EXPORT QgsAbstractFeatureIterator */ bool mZombie = false; + // TODO QGIS 4: make this private + /** * reference counting (to allow seamless copying of QgsFeatureIterator instances) - * TODO QGIS3: make this private */ int refs = 0; //! Add reference diff --git a/src/core/qgsmessageoutput.h b/src/core/qgsmessageoutput.h index ef867ebdcc6..25d35933ea5 100644 --- a/src/core/qgsmessageoutput.h +++ b/src/core/qgsmessageoutput.h @@ -66,11 +66,12 @@ class CORE_EXPORT QgsMessageOutput */ static void showMessage( const QString &title, const QString &message, MessageType msgType ); + // TODO: implementation where Python class could be passed + /** * sets function that will be used to create message output * \note not available in Python bindings */ - // TODO: implementation where Python class could be passed static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f ) SIP_SKIP; /** diff --git a/src/core/qgsproviderregistry.h b/src/core/qgsproviderregistry.h index 8968389c8c7..93cad5e14ce 100644 --- a/src/core/qgsproviderregistry.h +++ b/src/core/qgsproviderregistry.h @@ -56,10 +56,11 @@ class CORE_EXPORT QgsProviderRegistry public: + // TODO QGIS 4 - either move to QgsAbstractDataSourceWidget or remove altogether + /** * Different ways a source select dialog can be used */ - // TODO QGIS 4 - either move to QgsAbstractDataSourceWidget or remove altogether enum WidgetMode { diff --git a/src/core/raster/qgsrasterbandstats.h b/src/core/raster/qgsrasterbandstats.h index 6588c7871ce..ba84722fb76 100644 --- a/src/core/raster/qgsrasterbandstats.h +++ b/src/core/raster/qgsrasterbandstats.h @@ -76,8 +76,9 @@ class CORE_EXPORT QgsRasterBandStats //! \brief The gdal band number (starts at 1) int bandNumber; - //! \brief The number of not no data cells in the band. // TODO: check if no data are excluded in stats calculation + + //! \brief The number of not no data cells in the band. qgssize elementCount; /** diff --git a/src/core/raster/qgsrasterdataprovider.h b/src/core/raster/qgsrasterdataprovider.h index 4cde8effd92..3763a5c191c 100644 --- a/src/core/raster/qgsrasterdataprovider.h +++ b/src/core/raster/qgsrasterdataprovider.h @@ -450,8 +450,9 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast */ virtual bool setEditable( bool enabled ) { Q_UNUSED( enabled ) return false; } - //! Writes into the provider datasource // TODO: add data type (may be different from band type) + + //! Writes into the provider datasource virtual bool write( void *data, int band, int width, int height, int xOffset, int yOffset ) { Q_UNUSED( data ) diff --git a/src/core/raster/qgsrasteridentifyresult.h b/src/core/raster/qgsrasteridentifyresult.h index b9c7ad58e7c..3758a451ee1 100644 --- a/src/core/raster/qgsrasteridentifyresult.h +++ b/src/core/raster/qgsrasteridentifyresult.h @@ -84,9 +84,10 @@ class CORE_EXPORT QgsRasterIdentifyResult //! \brief Results format QgsRaster::IdentifyFormat mFormat = QgsRaster::IdentifyFormatUndefined; - //! \brief Results // TODO: better hierarchy (sublayer multiple feature sets)? // TODO?: results are not consistent for different formats (per band x per sublayer) + + //! \brief Results QMap mResults; //! \brief Additional params (e.g. request url used by WMS) diff --git a/src/gui/editorwidgets/core/qgseditorwidgetwrapper.h b/src/gui/editorwidgets/core/qgseditorwidgetwrapper.h index ade5fbcb002..158bb991118 100644 --- a/src/gui/editorwidgets/core/qgseditorwidgetwrapper.h +++ b/src/gui/editorwidgets/core/qgseditorwidgetwrapper.h @@ -283,6 +283,8 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper */ void setFeature( const QgsFeature &feature ) override; + // TODO Q_DECL_DEPRECATED + /** * Is called, when the value of the widget needs to be changed. Update the widget representation * to reflect the new value. @@ -290,7 +292,6 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper * \param value The new value of the attribute * \deprecated since QGIS 3.10 */ - // TODO Q_DECL_DEPRECATED virtual void setValue( const QVariant &value ) SIP_DEPRECATED; /** diff --git a/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h b/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h index ac5a567947d..71c49f6ddec 100644 --- a/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h +++ b/src/gui/editorwidgets/core/qgssearchwidgetwrapper.h @@ -172,6 +172,8 @@ class GUI_EXPORT QgsSearchWidgetWrapper : public QgsWidgetWrapper */ virtual bool applyDirectly() = 0; + // TODO QGIS 4.0 - make pure virtual + /** * Creates a filter expression based on the current state of the search widget * and the specified filter flags. @@ -179,7 +181,6 @@ class GUI_EXPORT QgsSearchWidgetWrapper : public QgsWidgetWrapper * \returns filter expression * \since QGIS 2.16 */ - // TODO QGIS 4.0 - make pure virtual virtual QString createExpression( FilterFlags flags ) const { Q_UNUSED( flags ) return QStringLiteral( "TRUE" ); } /** diff --git a/src/gui/qgsmapcanvas.h b/src/gui/qgsmapcanvas.h index 7182a358551..54b71a2af54 100644 --- a/src/gui/qgsmapcanvas.h +++ b/src/gui/qgsmapcanvas.h @@ -929,6 +929,8 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView */ void canvasColorChanged(); + // TODO: deprecate when decorations are reimplemented as map canvas items + /** * Emitted when the canvas has rendered. * Passes a pointer to the painter on which the map was drawn. This is @@ -936,11 +938,6 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView * rendered. Passing the painter allows plugins to work when the map is * being rendered onto a pixmap other than the mapCanvas own pixmap member. * - */ - - // TODO: deprecate when decorations are reimplemented as map canvas items - - /** * - anything related to rendering progress is not visible outside of map canvas * - additional drawing shall be done directly within the renderer job or independently as a map canvas item */