mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: select dives from Scatter Plot
When clicking on items in a plot, select the corresponding dives. This can be useful for data validation. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1797b59c10
commit
5c098eea29
10 changed files with 57 additions and 1 deletions
|
@ -64,10 +64,11 @@ StatsView::~StatsView()
|
|||
|
||||
void StatsView::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QPointF pos = event->localPos();
|
||||
|
||||
// Currently, we only support dragging of the legend. If other objects
|
||||
// should be made draggable, this needs to be generalized.
|
||||
if (legend) {
|
||||
QPointF pos = event->localPos();
|
||||
QRectF rect = legend->getRect();
|
||||
if (legend->getRect().contains(pos)) {
|
||||
dragStartMouse = pos;
|
||||
|
@ -75,8 +76,12 @@ void StatsView::mousePressEvent(QMouseEvent *event)
|
|||
draggedItem = &*legend;
|
||||
grabMouse();
|
||||
setKeepMouseGrab(true); // don't allow Qt to steal the grab
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &series: series)
|
||||
series->selectItemsUnderMouse(pos);
|
||||
}
|
||||
|
||||
void StatsView::mouseReleaseEvent(QMouseEvent *)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue