Elektrine lite

← Feed

@sgillies@mastodon.social

Post #1629683

2025-04-13 21:29 UTC

@nyalld what does "virtual" signify at https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.isModified? Python doesn't have virtual functions. Or you could consider all Python methods to be virtual, if you want.

Replies (1)

  • @nyalld@mastodon.social 2025-04-13 21:32

    @sgillies it's tagging the virtual methods in the underlying C++ code, i.e. those that are designed to be overridden and which will be overridden everywhere. Other methods can only be overridden when calling from Python, not C++. So eg overriding QgsMapLayer.name() in python code won't actually result in a different name shown for the layer in the qgis interface, as that's all C++ based...

    Open ##1629684