Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I disagree. Even if you only have a group in your layers panel, the script provided in the question body should return a number other than zero. That's the problem exposed by the question: length of root's children should not be zero for non-empty QGIS projects. See my answer. Commented Jul 4, 2017 at 0:52
  • I can confirm. Curiously, this approach does find layer groups without a proper call to setPrefixPath() but I don't get any layers returned. It works fine with setPrefixPath() in place, however; appreciate the suggestion.
    – Todd West
    Commented Jul 4, 2017 at 5:16