Skip to content

Commit 40acaa0

Browse files
committedJun 18, 2015
Deprecate QgsRasterLayer::setDrawingStyle() (fixes #12635)
1 parent 646b445 commit 40acaa0

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed
 

‎python/core/raster/qgsrasterlayer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class QgsRasterLayer : QgsMapLayer
170170
void setDefaultContrastEnhancement();
171171

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

175175
/** \brief [ data provider interface ] A wrapper function to emit a progress update signal */
176176
void showProgress( int theValue );

‎src/core/raster/qgsrasterlayer.h

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,6 @@ typedef QList < QPair< QString, QColor > > QgsLegendColorList;
127127
* }
128128
* \endcode
129129
*
130-
* You can combine layer type detection with the setDrawingStyle method to override the default drawing style assigned
131-
* when a layer is loaded:
132-
*
133-
* \code
134-
* if (rasterLayer->rasterType()==QgsRasterLayer::Multiband)
135-
* {
136-
* myRasterLayer->setDrawingStyle(QgsRasterLayer::MultiBandSingleBandPseudoColor);
137-
* }
138-
* else if (rasterLayer->rasterType()==QgsRasterLayer::Palette)
139-
* {
140-
* myRasterLayer->setDrawingStyle(QgsRasterLayer::PalettedSingleBandPseudoColor);
141-
* }
142-
* else // QgsRasterLayer::GrayOrUndefined
143-
* {
144-
* myRasterLayer->setDrawingStyle(QgsRasterLayer::SingleBandPseudoColor);
145-
* }
146-
* \endcode
147-
*
148130
* Raster layers can also have an arbitrary level of transparency defined, and have their
149131
* color palettes inverted using the setTransparency and setInvertHistogram methods.
150132
*
@@ -328,8 +310,10 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
328310
/** \brief Set default contrast enhancement */
329311
void setDefaultContrastEnhancement();
330312

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

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

411-
//DrawingStyle mDrawingStyle;
412-
413395
/** [ data provider interface ] Timestamp, the last modified time of the data source when the layer was created */
414396
QDateTime mLastModified;
415397

0 commit comments

Comments
 (0)
Please sign in to comment.