Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The QgslegendInterface implementation manages only top level items #217

Merged
merged 1 commit into from Sep 11, 2012

Conversation

endmax
Copy link
Contributor

@endmax endmax commented Aug 28, 2012

I need to create a groups/layers hierarchy starting from a third-party xml file. The QgslegendInterface implementation is limited to manage only top level item. I've no chance to create sub groups other than inside a top level group or add a layer into a sub-group.
The groupIndex/parentIndex used by the members of QgslegendInterface is used as an item index to top level items in the legend. So far the following members are limited to work only with top level items:

  • addGroup(QString name, bool expand, int parentIndex)
  • groupExists(int groupIndex)
  • isGroupExpanded(int groupIndex)
  • isGroupVisible(int groupIndex)
  • moveLayer(QgsMapLayer *ml, int groupIndex)
  • removeGroup(int groupIndex)
  • setGroupExpanded(int groupIndex, bool expand)
  • setGroupVisible(int groupIndex, bool visible)

I've modified the previous members in the way the groupIndex is a true index to all group hierarchy. Now the groupIndex values are in range 0 to len(QgslegendInterface.groups()).

Furthermore it would be usefull a moveLayer/moveGroup member to move a layer/group after or before another layer/group. In this way it would be possible to create a new project with an exact groups/layers hierarchy or integrate an existing project with a fragment o groups/layers hierarchy.

@timlinux
Copy link
Member

Hi

Thanks for popping in to IRC (its a good idea to hang out there as we cant always respond immediately).
I'm going to take a look - usually Marco Hugentobler would be the best person to look at this but he is travelling.

Regards

Tim

timlinux added a commit that referenced this pull request Sep 11, 2012
[FEATURE] The QgslegendInterface implementation updated to allow access to items and groups at all levels.
@timlinux timlinux merged commit 815f973 into qgis:master Sep 11, 2012
@timlinux
Copy link
Member

Thanks for this update!

yjacolin pushed a commit to yjacolin/QGIS that referenced this pull request Oct 4, 2014
User manual Screenshots - Raster Properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants