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

Method addElement

qcustomplot/qcustomplot.cpp:4134–4148  ·  view source on GitHub ↗

! \overload Adds the \a element to cell with \a row and \a column. If \a element is already in a layout, it is first removed from there. If \a row or \a column don't exist yet, the layout is expanded accordingly. Returns true if the element was added successfully, i.e. if the cell at \a row and \a column didn't already have an element. Use the overload of this method without explici

Source from the content-addressed store, hash-verified

4132 \see element, hasElement, take, remove
4133*/
4134bool QCPLayoutGrid::addElement(int row, int column, QCPLayoutElement *element)
4135{
4136 if (!hasElement(row, column))
4137 {
4138 if (element && element->layout()) // remove from old layout first
4139 element->layout()->take(element);
4140 expandTo(row+1, column+1);
4141 mElements[row][column] = element;
4142 if (element)
4143 adoptElement(element);
4144 return true;
4145 } else
4146 qDebug() << Q_FUNC_INFO << "There is already an element in the specified row/column:" << row << column;
4147 return false;
4148}
4149
4150/*! \overload
4151

Callers 1

QCustomPlotMethod · 0.80

Calls 2

takeMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected