Skip to content
Permalink
Browse files
Improve documentation
  • Loading branch information
nyalldawson authored and github-actions committed Oct 29, 2021
1 parent 5866c84 commit 3c8e09c4bb59f0854b04a6888eb9afe369f0c1c8
@@ -26,6 +26,9 @@ class QgsMultiBandColorRendererWidget: QgsRasterRendererWidget


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

virtual QString min( int index = 0 );

@@ -28,6 +28,9 @@ class QgsPalettedRendererWidget: QgsRasterRendererWidget


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

};

@@ -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
@@ -27,6 +27,9 @@ class QgsSingleBandGrayRendererWidget: QgsRasterRendererWidget


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 );
@@ -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:
@@ -44,6 +44,9 @@ class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget
QgsRasterRenderer *renderer() 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;
@@ -195,6 +195,9 @@ class GUI_EXPORT QgsPalettedRendererWidget: public QgsRasterRendererWidget, priv

QgsRasterRenderer *renderer() override;

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

private:
@@ -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; }

/**
@@ -41,6 +41,9 @@ class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget
QgsRasterRenderer *renderer() 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(); }
@@ -56,7 +56,9 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere
//! 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 3c8e09c

Please sign in to comment.