Skip to content

Commit

Permalink
Deprecate QgsRasterLayer::setDrawingStyle() (fixes #12635)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 18, 2015
1 parent 646b445 commit 40acaa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion python/core/raster/qgsrasterlayer.sip
Expand Up @@ -170,7 +170,7 @@ class QgsRasterLayer : QgsMapLayer
void setDefaultContrastEnhancement();

/** \brief Overloaded version of the above function for convenience when restoring from xml */
void setDrawingStyle( const QString & theDrawingStyleQString );
void setDrawingStyle( const QString & theDrawingStyleQString ) /Deprecated/;

/** \brief [ data provider interface ] A wrapper function to emit a progress update signal */
void showProgress( int theValue );
Expand Down
26 changes: 4 additions & 22 deletions src/core/raster/qgsrasterlayer.h
Expand Up @@ -127,24 +127,6 @@ typedef QList < QPair< QString, QColor > > QgsLegendColorList;
* }
* \endcode
*
* You can combine layer type detection with the setDrawingStyle method to override the default drawing style assigned
* when a layer is loaded:
*
* \code
* if (rasterLayer->rasterType()==QgsRasterLayer::Multiband)
* {
* myRasterLayer->setDrawingStyle(QgsRasterLayer::MultiBandSingleBandPseudoColor);
* }
* else if (rasterLayer->rasterType()==QgsRasterLayer::Palette)
* {
* myRasterLayer->setDrawingStyle(QgsRasterLayer::PalettedSingleBandPseudoColor);
* }
* else // QgsRasterLayer::GrayOrUndefined
* {
* myRasterLayer->setDrawingStyle(QgsRasterLayer::SingleBandPseudoColor);
* }
* \endcode
*
* Raster layers can also have an arbitrary level of transparency defined, and have their
* color palettes inverted using the setTransparency and setInvertHistogram methods.
*
Expand Down Expand Up @@ -328,8 +310,10 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** \brief Set default contrast enhancement */
void setDefaultContrastEnhancement();

/** \brief Overloaded version of the above function for convenience when restoring from xml */
void setDrawingStyle( const QString & theDrawingStyleQString );
/** \brief Overloaded version of the above function for convenience when restoring from xml
* @note Deprecated since QGIS 2.10. Use setRendererForDrawingStyle() or directly setRenderer()
*/
Q_DECL_DEPRECATED void setDrawingStyle( const QString & theDrawingStyleQString );

/** \brief [ data provider interface ] A wrapper function to emit a progress update signal */
void showProgress( int theValue );
Expand Down Expand Up @@ -408,8 +392,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
/** Pointer to data provider */
QgsRasterDataProvider* mDataProvider;

//DrawingStyle mDrawingStyle;

/** [ data provider interface ] Timestamp, the last modified time of the data source when the layer was created */
QDateTime mLastModified;

Expand Down

0 comments on commit 40acaa0

Please sign in to comment.