-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a changed signal to QgsRelationManager
- Loading branch information
1 parent
808464f
commit fb2279f
Showing
3 changed files
with
25 additions
and
1 deletion.
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
fb2279f
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.
What do you think about
relationAdded( const QgsRelation& )
andrelationRemoved( id )
signals? This would allow for more specific reactions.fb2279f
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 they would definitely be useful, but I think there's merit in an all-encompassing "changed" signal too.
fb2279f
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.
@nyalldawson I agree, there are use-cases for this as well.
I just fear that people will start to implement the logic to calculate the delta of the change operation all over the place (or will get it wrong and connect multiple times to signals of already existing relations).
Would it be possible to add the other signals as well?
fb2279f
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 ahh... I thought you were volunteering to do this ;) The biggest issue is with QgsRelationManager::setRelations, as that method clears the existing relations and totally rebuilds them. This makes it harder to correctly emit removed/added signals, as you'd need to manually check whether each has been added or removed before clearing the list. Unfortunately this is the method which the project properties dialog uses to set the relations. It's more work to tackle than I've got time left for the 2.6 freeze!