1

I know that for QgsVectorLayer, there is the QgsSymbolV2SelectorDialog dialog that I can call to allow users to change vector layer's styles. I am looking for an equivalent dialog for QgsRasterLayer. I found a QgsRasterRendererWidget and I put it in a QDialog, but when I instantiate it like:

layer = QgsRasterLayer() editor = QgsRasterRendererWidget(layer, layer.extent())

it gave the following exception:

TypeError: qgis._gui.QgsRasterRendererWidget represents a C++ abstract class and cannot be instantiated

So, is there a dialog class that I can use to open the raster property dialog to allow users to change raster render style?

0

For raster layer, use QgsSingleBandPseudoColorRendererWidget and QgsMultiBandColorRendererWidget

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.