Bug report #5748
QgsRasterLayer::setDrawingStyle() doesn't work
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||invalid|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||15254|
Here's the steps to reproduce it:
1. load a single band raster layer (named rl),
2. execute the following code on the raster layer
rl.setDrawingStyle(2) # now it's SingleBandPseudoColor rl.triggerRepaint()
the layer is not rendered at all.
If I change the drawing style from the Layer properties dialog and then if I call the snippet above again it works...
#3 Updated by Médéric RIBREUX over 4 years ago
- Status changed from Open to Feedback
Hello, bug triage...
in QGIS 2.13 master, when I set a raster from single band to pseudo-color from the layer properties, the result is a perfect empty raster. This is because there is no palette by default.
Even if the Python methods have changed with time, I think the behavior you described is normal (with no palette set, manually or passing by Python, a pseudocolor raster is always empty)...
Can we close this bug ?