In a Qt based application I'm developing I'm using a QGraphicsView to display sensor data in a 2D grid. On the side I'd like to show a legend/palette to relate the colours in the grid to values.
The user can zoom and pan the sensor data view, but understandably the palette should be stationary in the view. So placing the palette/legend in the sensor view scene requires some additional care: Applying the inverse user transformation.
However I'd rather have the palette/legend be implemented as kind of an (noninteractive) overlay layer with it's very own transformation. Is that somehow possible?
Here's a really easy way to get a floating legend (or etc), I tested it under Qt 4.8.5 and Qt 5.2.1:
This works well -- in particular, with this approach you don't have to compute any inverse coordinate transformations or change the view's update mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With