MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / setSelectionRectMode

Method setSelectionRectMode

3rdparty/qcustomplot/qcustomplot.cpp:13981–14002  ·  view source on GitHub ↗

! Sets how QCustomPlot processes mouse click-and-drag interactions by the user. If \a mode is \ref QCP::srmNone, the mouse drag is forwarded to the underlying objects. For example, QCPAxisRect may process a mouse drag by dragging axis ranges, see \ref QCPAxisRect::setRangeDrag. If \a mode is not \ref QCP::srmNone, the current selection rect (\ref selectionRect) becomes activated and all

Source from the content-addressed store, hash-verified

13979 \see setInteractions, setSelectionRect, QCPSelectionRect
13980*/
13981void QCustomPlot::setSelectionRectMode(QCP::SelectionRectMode mode)
13982{
13983 if (mSelectionRect)
13984 {
13985 if (mode == QCP::srmNone)
13986 mSelectionRect->cancel(); // when switching to none, we immediately want to abort a potentially active selection rect
13987
13988 // disconnect old connections:
13989 if (mSelectionRectMode == QCP::srmSelect)
13990 disconnect(mSelectionRect, SIGNAL(accepted(QRect,QMouseEvent*)), this, SLOT(processRectSelection(QRect,QMouseEvent*)));
13991 else if (mSelectionRectMode == QCP::srmZoom)
13992 disconnect(mSelectionRect, SIGNAL(accepted(QRect,QMouseEvent*)), this, SLOT(processRectZoom(QRect,QMouseEvent*)));
13993
13994 // establish new ones:
13995 if (mode == QCP::srmSelect)
13996 connect(mSelectionRect, SIGNAL(accepted(QRect,QMouseEvent*)), this, SLOT(processRectSelection(QRect,QMouseEvent*)));
13997 else if (mode == QCP::srmZoom)
13998 connect(mSelectionRect, SIGNAL(accepted(QRect,QMouseEvent*)), this, SLOT(processRectZoom(QRect,QMouseEvent*)));
13999 }
14000
14001 mSelectionRectMode = mode;
14002}
14003
14004/*!
14005 Sets the \ref QCPSelectionRect instance that QCustomPlot will use if \a mode is not \ref

Callers

nothing calls this directly

Calls 2

connectFunction · 0.85
cancelMethod · 0.45

Tested by

no test coverage detected