Skip to content

Commit

Permalink
#870 Detach plot marker when plot looses focus
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Nov 11, 2016
1 parent 9594685 commit 31b1299
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions ApplicationCode/UserInterface/RiuSummaryQwtPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,19 @@ bool RiuSummaryQwtPlot::eventFilter(QObject* watched, QEvent* event)
}


//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::leaveEvent(QEvent *)
{
if (m_plotMarker->plot())
{
m_plotMarker->detach();

replot();
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion ApplicationCode/UserInterface/RiuSummaryQwtPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class RiuSummaryQwtPlot : public QwtPlot
void updateClosestCurvePointMarker(const QPointF& pos, int yAxis);

protected:
virtual bool eventFilter(QObject* watched, QEvent* event);
virtual bool eventFilter(QObject* watched, QEvent* event) override;
virtual void leaveEvent(QEvent *) override;

private:
void setDefaults();
Expand Down

0 comments on commit 31b1299

Please sign in to comment.