MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / setSelectionRect

Method setSelectionRect

qcustomplot/qcustomplot.cpp:13275–13290  ·  view source on GitHub ↗

! Sets the \ref QCPSelectionRect instance that QCustomPlot will use if \a mode is not \ref QCP::srmNone and the user performs a click-and-drag interaction. QCustomPlot takes ownership of the passed \a selectionRect. It can be accessed later via \ref selectionRect. This method is useful if you wish to replace the default QCPSelectionRect instance with an instance of a QCPSelectionRect

Source from the content-addressed store, hash-verified

13273 \see setSelectionRectMode
13274*/
13275void QCustomPlot::setSelectionRect(QCPSelectionRect *selectionRect)
13276{
13277 if (mSelectionRect)
13278 delete mSelectionRect;
13279
13280 mSelectionRect = selectionRect;
13281
13282 if (mSelectionRect)
13283 {
13284 // establish connections with new selection rect:
13285 if (mSelectionRectMode == QCP::srmSelect)
13286 connect(mSelectionRect, SIGNAL(accepted(QRect,QMouseEvent*)), this, SLOT(processRectSelection(QRect,QMouseEvent*)));
13287 else if (mSelectionRectMode == QCP::srmZoom)
13288 connect(mSelectionRect, SIGNAL(accepted(QRect,QMouseEvent*)), this, SLOT(processRectZoom(QRect,QMouseEvent*)));
13289 }
13290}
13291
13292/*!
13293 \warning This is still an experimental feature and its performance depends on the system that it

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected