Bug report #12635

QgsRasterLayer.setDrawingStyle string version is in the bindings instead of the enum version

Added by Alessandro Pasotti almost 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Python plugins
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20750

Description

In SIP bindings there is the QString version of the overloaded setDrawingStyle:

void setDrawingStyle( const QString & theDrawingStyleQString );

The pyqgis cookbook examples refer to the enum version:

rlayer.setDrawingStyle(QgsRasterLayer.SingleBandPseudoColor)

is this intentional?

Do we have to fix the cookbook or ths SIP bindings?

Maybe related but the cookbook still mentions

rlayer.drawingStyle()

which is not available anymore, additionally it seems that there is not a way to get the ENUM from the renderer, all I can get is a lowercase string such as:

rlayer.renderer().type()
u'singlebandpseudocolor'

Associated revisions

Revision 40acaa05
Added by Martin Dobias almost 9 years ago

Deprecate QgsRasterLayer::setDrawingStyle() (fixes #12635)

History

#1 Updated by Martin Dobias almost 9 years ago

  • Status changed from Open to Closed

#2 Updated by Martin Dobias almost 9 years ago

The setDrawingStyle() method is completely obsolete. I have also updated the cookbook: https://github.com/qgis/QGIS-Documentation/commit/052ff6cce5eb3d48a6fc65f0d7662819a2da30a6

Also available in: Atom PDF