Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add iface.layerTreeCanvasBridge()
- Loading branch information
Showing
4 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70fe622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-kuhn can you please check that the manual example using the bridge is still valid? https://github.com/qgis/QGIS-Documentation/blob/master/source/docs/pyqgis_developer_cookbook/loadproject.rst#id21
70fe622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
70fe622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That part of the cookbook is not specific to standalone (look at the bridge example at the end of the page), anyway maybe worth adding that new iface method to the cookbook (possibly with a short example).
Generally speaking, I believe that when something is added to iface or to the bindings, it should be documented in the cookbook.
70fe622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and the bridge example at the end of the page looks a bit odd to me.
A simple
QgsProject.instance().read('test.qgs')
works perfectly. fine, I don't see a reason why the bridge is required. (I left a comment there)From my point of view:
The only reason for using an own bridge I have come across so far is for a standalone applicaiton.
Within the Qgis app it makes sense to use the one bridge which is created by Qgis itself (e.g. to synchronize the state between the layer rendering order widget and the map canvas layer rendering order).
70fe622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-kuhn , you are right, in master it's not needed, I don't remember if I added it while testing on an older version or if I messed up something while testing a long chain of commands.
Since you know very well how that part of the code works (or is supposed to work) It would be awesome if you could fix that part of the cookbook and add a short example/use case for the new
iface.layerTreeCanvasBridge