-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[FEATURE] [Identify tool] Present referencing relations (in addition … #57863
Conversation
…to referenced ones), and support them on arbitrary nesting level Fixes qgis#48776 Previously only referenced relations where presented when exploring a feature, now referenced ones are presented as well. Do that only when the user explicit unfolds a node, to avoid potential 'explosion' of the number of features in the tree in case of a huge database where all features would be connected through relations. If through relations a feature already present in an ancestor node is detected, it is omitted from the related features. Add setting parameters to disable showing referenced and referencing relations. Add a contextual menu item "Explore Feature" to be able to "re-center" the result of the identification tree on a nested feature, to limit the nesting depth.
QFont italicFont; | ||
italicFont.setItalic( true ); | ||
relationItem->setFont( 0, italicFont ); | ||
relationItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( relation.referencedLayer() ) ) ); |
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.
This looks dangerous -- do we do this elsewhere? I think it'd be safer to use the layer id here instead . Otherwise there could be a crash if the child layer is removed before the relation is expanded
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.
This looks dangerous -- do we do this elsewhere?
yes, for example
QGIS/src/app/qgsidentifyresultsdialog.cpp
Line 568 in 81c28c4
layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( vlayer ) ) ); |
src/ui/qgsidentifyresultsbase.ui
Outdated
<bool>true</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Show referenced relations</string> |
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.
<string>Show referenced relations</string> | |
<string>Show Referenced Relations</string> |
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.
done, and merged as a single setting as suggested
@@ -0,0 +1,270 @@ | |||
/*************************************************************************** | |||
testqgsidentifyresultsdialog.cpp |
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.
There's other tests for the dialog in the identify map tool tests. Maybe we should put these new ones in there, and then rename to just testqgsidentify.cpp?
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.
done
I also have some ui suggestions:
What about having just a single action for "show relations", which applies to both? I'm worried about UI complexity. Honestly a decade later of using relations in qgis and I'm STILL confused by the referencing/referenced terminology 😝
How about "Identify Feature" instead? We don't use "explore" anywhere else, so I'm concerned this action won't be immediately understandable. |
@rouault A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
…ntifyresultsdialog.cpp into testqgsidentify.cpp
done
This both reassures and worries me as I'm also deeply confused :-)
done |
@rouault |
…to referenced ones), and support them on arbitrary nesting level
Fixes #48776
Previously only referenced relations where presented when exploring a feature, now referenced ones are presented as well. Do that only when the user explicit unfolds a node, to avoid potential 'explosion' of the number of features in the tree in case of a huge database where all features would be connected through relations. If through relations a feature already present in an ancestor node is detected, it is omitted from the related features.
Add setting parameters to disable showing relations
Add a contextual menu item "Identify Feature" to be able to "re-center" the result of the identification tree on a nested feature, to limit the nesting depth.
==>