1

So I'm writing some script for QGIS 1.8 and I'm unable to resolve this error.

from qgis.core import *
pallyr = QgsPalLayerSettings()

The second line gives me error that QgsPalLayerSettings is not defined. When I do it in QGIS 2 or higher then i don't get any errors and it imports this class. Somehow I have to stick to QGIS 1.8. How can this be resolved?

  • Not sure, what about removing the brackets? (e.g. from qgis.core import QgsPalLayerSettings) – Joseph Aug 7 '15 at 15:01
  • No luck so far, this also gives me the same error. – M Omayr Aug 7 '15 at 15:15
  • Are you sure it was already available in 1.8, i.e. part of the API? – lynxlynxlynx Aug 7 '15 at 18:05
  • @lynxlynxlynx yes I'm sure and here's the link to this class in API documentation of QGIS 1.8 qgis.org/api/1.8/classQgsPalLayerSettings.html – M Omayr Aug 7 '15 at 20:38
  • That's the C++ API, you need to check the python one. Things have to be manually marked for the bindings to be generated. – lynxlynxlynx Aug 20 '15 at 15:49

Your Answer

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

Browse other questions tagged or ask your own question.