statistics: implement moving of legend

Catch mouse move events and move the legend accordingly.
Currently, this is the only item that can be dragged and
therefore there is no need of doing some kind of fancy
interface. Simply keep a pointer to the legend if it is
dragged.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-13 13:23:41 +01:00 committed by bstoeger
parent 2b961414d7
commit 1a869833d8
3 changed files with 53 additions and 4 deletions

View file

@ -14,7 +14,6 @@ class QFontMetrics;
class Legend : public ChartRectItem {
public:
Legend(StatsView &view, const std::vector<QString> &names);
void hover(QPointF pos);
void resize(); // called when the chart size changes.
private:
// Each entry is a text besides a rectangle showing the color