Skip to main content
1 of 7
Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130

You should call QgsRasterLayer.triggerRepaint()

If your layer is called myLayer call

myLayer.triggerRepaint()

The same method exists for vector layers as well.

Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130