Skip to content
Permalink
Browse files
Merge pull request #45720 from qgis/backport-45713-to-release-3_22
[Backport release-3_22] Add some missing /Factory/ annotations
  • Loading branch information
m-kuhn committed Nov 1, 2021
2 parents 93d83b8 + ac1957a commit 9ed276813723246e137024eaf7c200faa906a6e1
@@ -37,13 +37,8 @@ Renderer widget for the hill shade renderer.
Factory method to create the renderer for this type.
%End

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

%Docstring
The renderer for the widget.

:return: A new renderer for the the config in the widget
%End

void setFromRenderer( const QgsRasterRenderer *renderer );
%Docstring
@@ -20,12 +20,15 @@ class QgsMultiBandColorRendererWidget: QgsRasterRendererWidget
QgsMultiBandColorRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent = QgsRectangle() );
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent );

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

virtual void setMapCanvas( QgsMapCanvas *canvas );


void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Sets the widget state from the specified renderer.
%End

virtual QString min( int index = 0 );

@@ -24,10 +24,13 @@ class QgsPalettedRendererWidget: QgsRasterRendererWidget
~QgsPalettedRendererWidget();
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) /Factory/;

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;


void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Sets the widget state from the specified renderer.
%End

};

@@ -30,7 +30,7 @@ Constructs the widget
Widget creation function (mainly for the use by the renderer registry)
%End

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

};

@@ -13,6 +13,10 @@

class QgsRasterRendererWidget: QWidget
{
%Docstring(signature="appended")

Abstract base class for widgets which configure a :py:class:`QgsRasterRenderer`.
%End

%TypeHeaderCode
#include "qgsrasterrendererwidget.h"
@@ -22,9 +26,25 @@ class QgsRasterRendererWidget: QWidget
QgsRasterRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent );

virtual QgsRasterRenderer *renderer() = 0 /Factory/;
%Docstring
Creates a new renderer, using the properties defined in the widget.

The caller takes ownership of the returned renderer.
%End

void setRasterLayer( QgsRasterLayer *layer );
%Docstring
Sets the raster ``layer`` associated with the widget.

.. seealso:: :py:func:`rasterLayer`
%End

const QgsRasterLayer *rasterLayer() const;
%Docstring
Returns the raster layer associated with the widget.

.. seealso:: :py:func:`setRasterLayer`
%End

virtual void setMapCanvas( QgsMapCanvas *canvas );
%Docstring
@@ -21,12 +21,15 @@ class QgsSingleBandGrayRendererWidget: QgsRasterRendererWidget

static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) /Factory/;

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

virtual void setMapCanvas( QgsMapCanvas *canvas );


void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Sets the widget state from the specified renderer.
%End

virtual QString min( int index = 0 );
virtual QString max( int index = 0 );
@@ -33,7 +33,7 @@ Creates new raster renderer widget
Creates new raster renderer widget
%End

virtual QgsRasterRenderer *renderer();
virtual QgsRasterRenderer *renderer() /Factory/;

virtual void setMapCanvas( QgsMapCanvas *canvas );

@@ -49,7 +49,7 @@ Returns the current raster band number

void setFromRenderer( const QgsRasterRenderer *r );
%Docstring
Set state of the widget from renderer settings
Sets the widget state from the specified renderer.
%End

public slots:
@@ -48,11 +48,7 @@ class GUI_EXPORT QgsHillshadeRendererWidget: public QgsRasterRendererWidget, pri
*/
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsHillshadeRendererWidget( layer, extent ); }

/**
* \brief The renderer for the widget.
* \returns A new renderer for the the config in the widget
*/
QgsRasterRenderer *renderer() override;
QgsRasterRenderer *renderer() override SIP_FACTORY;

/**
* \brief Set the widget state from the given renderer.
@@ -41,9 +41,12 @@ class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget
QgsMultiBandColorRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent = QgsRectangle() );
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) { return new QgsMultiBandColorRendererWidget( layer, extent ); }

QgsRasterRenderer *renderer() override;
QgsRasterRenderer *renderer() override SIP_FACTORY;
void setMapCanvas( QgsMapCanvas *canvas ) override;

/**
* Sets the widget state from the specified renderer.
*/
void setFromRenderer( const QgsRasterRenderer *r );

QString min( int index = 0 ) override;
@@ -193,8 +193,11 @@ class GUI_EXPORT QgsPalettedRendererWidget: public QgsRasterRendererWidget, priv
~QgsPalettedRendererWidget() override;
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsPalettedRendererWidget( layer, extent ); }

QgsRasterRenderer *renderer() override;
QgsRasterRenderer *renderer() SIP_FACTORY override;

/**
* Sets the widget state from the specified renderer.
*/
void setFromRenderer( const QgsRasterRenderer *r );

private:
@@ -36,7 +36,7 @@ class GUI_EXPORT QgsRasterContourRendererWidget : public QgsRasterRendererWidget
//! Widget creation function (mainly for the use by the renderer registry)
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsRasterContourRendererWidget( layer, extent ); }

QgsRasterRenderer *renderer() override;
QgsRasterRenderer *renderer() SIP_FACTORY override;
};

#endif // QGSRASTERCONTOURRENDERERWIDGET_H
@@ -32,6 +32,8 @@ class QgsRasterMinMaxWidget;
/**
* \ingroup gui
* \class QgsRasterRendererWidget
*
* \brief Abstract base class for widgets which configure a QgsRasterRenderer.
*/
class GUI_EXPORT QgsRasterRendererWidget: public QWidget
{
@@ -45,9 +47,25 @@ class GUI_EXPORT QgsRasterRendererWidget: public QWidget
, mExtent( extent )
{}

/**
* Creates a new renderer, using the properties defined in the widget.
*
* The caller takes ownership of the returned renderer.
*/
virtual QgsRasterRenderer *renderer() = 0 SIP_FACTORY;

/**
* Sets the raster \a layer associated with the widget.
*
* \see rasterLayer()
*/
void setRasterLayer( QgsRasterLayer *layer ) { mRasterLayer = layer; }

/**
* Returns the raster layer associated with the widget.
*
* \see setRasterLayer()
*/
const QgsRasterLayer *rasterLayer() const { return mRasterLayer; }

/**
@@ -38,9 +38,12 @@ class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget

static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandGrayRendererWidget( layer, extent ); }

QgsRasterRenderer *renderer() override;
QgsRasterRenderer *renderer() SIP_FACTORY override;
void setMapCanvas( QgsMapCanvas *canvas ) override;

/**
* Sets the widget state from the specified renderer.
*/
void setFromRenderer( const QgsRasterRenderer *r );

QString min( int index = 0 ) override { Q_UNUSED( index ) return mMinLineEdit->text(); }
@@ -48,15 +48,17 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere
//! Creates new raster renderer widget
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandPseudoColorRendererWidget( layer, extent ); }

QgsRasterRenderer *renderer() override;
QgsRasterRenderer *renderer() SIP_FACTORY override;
void setMapCanvas( QgsMapCanvas *canvas ) override;
void doComputations() override;
QgsRasterMinMaxWidget *minMaxWidget() override;

//! Returns the current raster band number
int currentBand() const;

//! Set state of the widget from renderer settings
/**
* Sets the widget state from the specified renderer.
*/
void setFromRenderer( const QgsRasterRenderer *r );

public slots:

0 comments on commit 9ed2768

Please sign in to comment.