jorgealmerio / valuetool

QGis plugin to display in a table or plot the values from the visible raster layers at the current mouse position
4 stars 7 forks source link

Add raster value as a tooltip #22

Open jfbourdon opened 2 years ago

jfbourdon commented 2 years ago

For Feature Request https://github.com/jorgealmerio/valuetool/issues/11 about displaying only the value one raster at the bottom of QGIS. Doing exactly that doesn't seem possible, but displaying the value as a tooltip where the cursor sits is: tooltip

It's really a draft at this point, I essentially took the code from this answer on SO without doing much integration.

Any comments are welcome (@ar-siddiqui)

ar-siddiqui commented 2 years ago

Looks great. It serves the purpose. After I closed the value tool dialogue box, it still continued to show the tooltip, which is great.

I had a couple of issues, one is that the Enable tooltip option was greyed out for me initially, it only became available when I unchecked the Enable button and then checked it again.

image

Another problem I face is that if you change the cursor to something else, like let's say Select Feature, then tooltips disappear and you have to open the Value tool dialogue again and enable the tooltip again. Possible solutions:

  1. Have tooltips always on, for all types of cursors.
  2. Provide 3 dedicated buttons like these to achieve
    • Open Dialog Box
    • Turn tooltip on without opening dialogue box
    • Bring up Value Tool i cursor without opening dialogue box image

The benefit of # 2 solution is that it separate out the concerns, one can achieve either use case without triggering the other

jorgealmerio commented 2 years ago

Added to master! Sorry for delay!

jfbourdon commented 2 years ago

@jorgealmerio It isn't ready yet! It's too crude (and buggy) at the moment and I don't have time right now to do more tweaking but I will eventually. That's why I set the PR as a draft :)

That being said, do you have any thoughts on how this functionality should be integrated? I was thinking of a button like I did, but does using a dialog box as suggested by ar-siddiqui would be ok? I'm thinking to (in a future PR) suggest a functionality like the Pixel Inspector from ArcMap that might also be appropriate to activate via a dialog box directly.