Skip to content

Commit

Permalink
Re #9875. Drag only when all plot tools are off.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jul 11, 2014
1 parent 9c09868 commit 69a265a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
37 changes: 34 additions & 3 deletions Code/Mantid/MantidPlot/src/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ Graph::Graph(int x, int y, int width, int height, QWidget* parent, Qt::WFlags f)
setAttribute(Qt::WA_DeleteOnClose, false);

d_plot = new Plot(width, height, this);
connect (d_plot,SIGNAL(dragMousePress(QPoint)), this, SIGNAL(dragMousePress(QPoint)));
connect (d_plot,SIGNAL(dragMouseRelease(QPoint)), this, SIGNAL(dragMouseRelease(QPoint)));
connect (d_plot,SIGNAL(dragMouseMove(QPoint)), this, SIGNAL(dragMouseMove(QPoint)));
connect (d_plot,SIGNAL(dragMousePress(QPoint)), this, SLOT(slotDragMousePress(QPoint)));
connect (d_plot,SIGNAL(dragMouseRelease(QPoint)), this, SLOT(slotDragMouseRelease(QPoint)));
connect (d_plot,SIGNAL(dragMouseMove(QPoint)), this, SLOT(slotDragMouseMove(QPoint)));

cp = new CanvasPicker(this);

Expand Down Expand Up @@ -6115,3 +6115,34 @@ void Graph::checkValuesInAxisRange(MantidMatrixCurve* mc)
d_plot->setAxisScale(QwtPlot::Axis(QwtPlot::xBottom), xMin, xMax);
}
}

/**
* Process dragMousePress signal from d_plot.
* @param pos :: Mouse position.
*/
void Graph::slotDragMousePress(QPoint pos)
{
if ( hasActiveTool() ) return;
emit dragMousePress(pos);
}

/**
* Process dragMouseRelease signal from d_plot.
* @param pos :: Mouse position.
*/
void Graph::slotDragMouseRelease(QPoint pos)
{
if ( hasActiveTool() ) return;
emit dragMouseRelease(pos);
}

/**
* Process dragMouseMove signal from d_plot.
* @param pos :: Mouse position.
*/
void Graph::slotDragMouseMove(QPoint pos)
{
if ( hasActiveTool() ) return;
emit dragMouseMove(pos);
}

4 changes: 4 additions & 0 deletions Code/Mantid/MantidPlot/src/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ public slots:

private slots:

void slotDragMousePress(QPoint);
void slotDragMouseRelease(QPoint);
void slotDragMouseMove(QPoint);

private:
//! Finds bounding interval of the plot data.
QwtDoubleInterval axisBoundingInterval(int axis);
Expand Down

0 comments on commit 69a265a

Please sign in to comment.