canvas = iface.mapCanvas() canvas.enableAntiAliasing(True)
canvas = iface.mapCanvas() canvas.enableAntiAliasing(False)This example is similar to the first one. However, in this case, the anti-aliasing is disabled by setting the parameter to False. In both examples, the code uses the QGIS Python API to access the map canvas object and set the value of the enableAntiAliasing property to enable or disable anti-aliasing. The QGIS Python API is the package library used for this code.